diff options
author | Jordan Borean <jborean93@gmail.com> | 2022-09-30 02:35:45 +0300 |
---|---|---|
committer | Jordan Borean <jborean93@gmail.com> | 2022-11-02 01:18:38 +0300 |
commit | 4ad02dc6e3103e49fb6a54a98c254c12922e3042 (patch) | |
tree | 1b8d98e9077e75f1dff60404ed692ad347b6c53f | |
parent | bfcb55777773572c9f96d266494049ccbb7cac50 (diff) |
ansible-test - Update PSScriptAnalyzer to 1.21.0
3 files changed, 34 insertions, 25 deletions
diff --git a/changelogs/fragments/psscriptanalyzer-1.21.0.yml b/changelogs/fragments/psscriptanalyzer-1.21.0.yml new file mode 100644 index 00000000000..e74b3d6b83a --- /dev/null +++ b/changelogs/fragments/psscriptanalyzer-1.21.0.yml @@ -0,0 +1,4 @@ +minor_changes: +- >- + ansible-test pslint - Upgrade PSScriptAnalyzer to ``1.21.0`` which enables the ``AvoidMultipleTypeAttributes``, + ``AvoidSemicolonsAsLineTerminators``, and ``AvoidUsingBrokenHashAlgorithms`` rules diff --git a/test/lib/ansible_test/_data/requirements/sanity.pslint.ps1 b/test/lib/ansible_test/_data/requirements/sanity.pslint.ps1 index 68545c9e94f..df36d61affa 100644 --- a/test/lib/ansible_test/_data/requirements/sanity.pslint.ps1 +++ b/test/lib/ansible_test/_data/requirements/sanity.pslint.ps1 @@ -28,8 +28,10 @@ Function Install-PSModule { } } +# Versions changes should be made first in ansible-test which is then synced to +# the default-test-container over time Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Install-PSModule -Name PSScriptAnalyzer -RequiredVersion 1.20.0 +Install-PSModule -Name PSScriptAnalyzer -RequiredVersion 1.21.0 if ($IsContainer) { # PSScriptAnalyzer contain lots of json files for the UseCompatibleCommands check. We don't use this rule so by diff --git a/test/lib/ansible_test/_util/controller/sanity/pslint/settings.psd1 b/test/lib/ansible_test/_util/controller/sanity/pslint/settings.psd1 index 2ae13b4c2e5..41be367404b 100644 --- a/test/lib/ansible_test/_util/controller/sanity/pslint/settings.psd1 +++ b/test/lib/ansible_test/_util/controller/sanity/pslint/settings.psd1 @@ -1,37 +1,40 @@ @{ - Rules = @{ - PSAvoidLongLines = @{ - Enable = $true + Rules = @{ + PSAvoidLongLines = @{ + Enable = $true MaximumLineLength = 160 } - PSPlaceOpenBrace = @{ + PSAvoidSemicolonsAsLineTerminators = @{ Enable = $true - OnSameLine = $true + } + PSPlaceOpenBrace = @{ + Enable = $true + OnSameLine = $true IgnoreOneLineBlock = $true - NewLineAfter = $true + NewLineAfter = $true } - PSPlaceCloseBrace = @{ - Enable = $true + PSPlaceCloseBrace = @{ + Enable = $true IgnoreOneLineBlock = $true - NewLineAfter = $true - NoEmptyLineBefore = $false + NewLineAfter = $true + NoEmptyLineBefore = $false } - PSUseConsistentIndentation = @{ - Enable = $true - IndentationSize = 4 + PSUseConsistentIndentation = @{ + Enable = $true + IndentationSize = 4 PipelineIndentation = 'IncreaseIndentationForFirstPipeline' - Kind = 'space' + Kind = 'space' } - PSUseConsistentWhitespace = @{ - Enable = $true - CheckInnerBrace = $true - CheckOpenBrace = $true - CheckOpenParen = $true - CheckOperator = $true - CheckPipe = $true - CheckPipeForRedundantWhitespace = $false - CheckSeparator = $true - CheckParameter = $false + PSUseConsistentWhitespace = @{ + Enable = $true + CheckInnerBrace = $true + CheckOpenBrace = $true + CheckOpenParen = $true + CheckOperator = $true + CheckPipe = $true + CheckPipeForRedundantWhitespace = $false + CheckSeparator = $true + CheckParameter = $false IgnoreAssignmentOperatorInsideHashTable = $false } } |