Skip to content

Commit

Permalink
Merge pull request #349 from Lombiq/issue/OSOE-833
Browse files Browse the repository at this point in the history
OSOE-833: Upgrade PSScriptAnalyzer to 1.22
  • Loading branch information
sarahelsaig authored May 15, 2024
2 parents 3600822 + b98dfaf commit d7ce43c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
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

0 comments on commit d7ce43c

Please sign in to comment.