Skip to content

Commit

Permalink
Attempting to dry the configuration for expected code analysis errors…
Browse files Browse the repository at this point in the history
… in the test-analysis-failure workflow
  • Loading branch information
BenedekFarkas committed Jan 11, 2023
1 parent 01f8b64 commit 11b5985
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/test-analysis-failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ on:
branches:
- dev

env:
EXPECTED_CODE_ANALYSIS_ERRORS: |
MSB3073: The command exited with non-zero code.
PSAvoidUsingAutomaticVariableAlias: '$_' is an alias of '$PSItem'.
PSAvoidUsingCmdletAliases: '%' is an alias of 'ForEach-Object'.
PSAvoidUsingEmptyCatchBlock: Empty catch block is used.
PSAvoidUsingLineContinuation: Using backtick (line continuation) makes the code harder to read and maintain.
PSUseApprovedVerbs: The cmdlet 'Violate-Analyzers' uses an unapproved verb.
PSUseSingularNouns: The cmdlet 'Violate-Analyzers' uses a plural noun.
PSAvoidUsingWriteHost: File 'Violate-Analyzers.ps1' uses Write-Host.
PSUseConsistentIndentation: Indentation not consistent
jobs:
call-test-analysis-failure-nuget:
if: false
Expand All @@ -16,16 +28,7 @@ jobs:
machine-types: "['ubuntu-latest', 'windows-latest']"
build-directory: TestSolutions/Lombiq.Analyzers.PowerShell.PackageReference
timeout-minutes: 30
build-expected-code-analysis-errors: |
MSB3073: The command exited with non-zero code.
PSAvoidUsingAutomaticVariableAlias: '$_' is an alias of '$PSItem'.
PSAvoidUsingCmdletAliases: '%' is an alias of 'ForEach-Object'.
PSAvoidUsingEmptyCatchBlock: Empty catch block is used.
PSAvoidUsingLineContinuation: Using backtick (line continuation) makes the code harder to read and maintain.
PSUseApprovedVerbs: The cmdlet 'Violate-Analyzers' uses an unapproved verb.
PSUseSingularNouns: The cmdlet 'Violate-Analyzers' uses a plural noun.
PSAvoidUsingWriteHost: File 'Violate-Analyzers.ps1' uses Write-Host.
PSUseConsistentIndentation: Indentation not consistent
build-expected-code-analysis-errors: ${{ env.EXPECTED_CODE_ANALYSIS_ERRORS }}

call-test-analysis-failure-local:
name: Test Analysis Failure - Local ProjectReference
Expand All @@ -34,13 +37,4 @@ jobs:
machine-types: "['ubuntu-latest', 'windows-latest']"
build-directory: TestSolutions/Lombiq.Analyzers.PowerShell.ProjectReference
timeout-minutes: 30
build-expected-code-analysis-errors: |
MSB3073: The command exited with non-zero code.
PSAvoidUsingAutomaticVariableAlias: '$_' is an alias of '$PSItem'.
PSAvoidUsingCmdletAliases: '%' is an alias of 'ForEach-Object'.
PSAvoidUsingEmptyCatchBlock: Empty catch block is used.
PSAvoidUsingLineContinuation: Using backtick (line continuation) makes the code harder to read and maintain.
PSUseApprovedVerbs: The cmdlet 'Violate-Analyzers' uses an unapproved verb.
PSUseSingularNouns: The cmdlet 'Violate-Analyzers' uses a plural noun.
PSAvoidUsingWriteHost: File 'Violate-Analyzers.ps1' uses Write-Host.
PSUseConsistentIndentation: Indentation not consistent
build-expected-code-analysis-errors: ${{ env.EXPECTED_CODE_ANALYSIS_ERRORS }}

0 comments on commit 11b5985

Please sign in to comment.