Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-833: Upgrade PSScriptAnalyzer to 1.22 #349

Merged
merged 8 commits into from
May 15, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $body = ConvertTo-Json $annotation -Compress
# Az CLI and Invoke-AzRestMethod both work in GitHub Actions, but Az throws various (inconsistent) errors in localhost.
Invoke-AzRestMethod -Path "$ApplicationInsightsResourceId/Annotations?api-version=2015-05-01" -Method PUT -Payload $body

if (!$?)
if (-not $?)
{
exit 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dotnet build $SolutionOrProject @buildSwitches 2>&1 | ForEach-Object {
if ($noErrors) { Write-Output "::error file=$file,line=$line,col=$column::$message" }
}

if ($noErrors -and !$?)
if ($noErrors -and -not $?)
{
exit 1
}
Expand Down Expand Up @@ -122,4 +122,3 @@ if ($expectedErrorCodes)
Write-Output 'Verification complete, the solution or project only has the expected errors!'
exit 0
}

2 changes: 1 addition & 1 deletion .github/actions/publish-nuget/New-NuGetPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function Get-ProjectProperty

$shouldDownloadBaseLinePackages = ($EnablePackageValidation -And
$PackageValidationBaselineVersion -And
!($Version -match '-(alpha|beta|preview|rc)[.-]') -And
-not ($Version -match '-(alpha|beta|preview|rc)[.-]') -And
$Version.Split('.')[0] -le $PackageValidationBaselineVersion.Split('.')[0])

$projects = (Test-Path *.sln) ? (dotnet sln list | Select-Object -Skip 2 | Get-Item) : (Get-ChildItem *.csproj)
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/test-dotnet/Invoke-SolutionTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ foreach ($test in $tests)

$processResult = StartProcessAndWaitForExit -FileName 'dotnet' -Arguments "test $($dotnetTestSwitches -join ' ')" -Timeout $TestProcessTimeout

if ($processResult.ExitCode -eq 0 -or (!$processResult.HasExited -and $processResult.HasTestRunSuccessfully))
if ($processResult.ExitCode -eq 0 -or (-not $processResult.HasExited -and $processResult.HasTestRunSuccessfully))
{
if (!$processResult.HasExited)
if (-not $processResult.HasExited)
{
Write-Output "::warning::The process $($processResult.ProcessId) for $test was killed but the tests were successful."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ param(
[string] $Branch
)

if (!($Branch -match '(\w+-\d+)'))
if (-not ($Branch -match '(\w+-\d+)'))
{
exit
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
dotnet-version: ${{ inputs.dotnet-version }}

- name: Publish to NuGet
uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-838-publish-nuget
uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev
with:
source: ${{ inputs.source }}
verbosity: ${{ inputs.verbosity }}
Expand Down
Loading