Skip to content

Commit 0b71771

Browse files
committed
Tweak parameters:
- InspectCode: Fix profile parameter, do not check for updates, include framework - CleanupCode: Build first, do not check for updates
1 parent a6990fc commit 0b71771

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
$inspectCodeOutputPath = Join-Path $env:RUNNER_TEMP 'jetbrains-inspectcode-results.xml'
179179
Write-Output "INSPECT_CODE_OUTPUT_PATH=$inspectCodeOutputPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
180180
dotnet jb inspectcode --version
181-
dotnet jb inspectcode $env:SOLUTION_FILE --build --dotnetcoresdk=$(dotnet --version) --output="$inspectCodeOutputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --properties:RunAnalyzers=false --properties:NuGetAudit=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
181+
dotnet jb inspectcode $env:SOLUTION_FILE --build --no-updates --dotnetcoresdk=$(dotnet --version) --output="$inspectCodeOutputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:ContinuousIntegrationBuild=false --properties:RunAnalyzers=false --properties:NuGetAudit=false --severity=WARNING --verbosity=WARN --disable-settings-layers=GlobalAll --disable-settings-layers=GlobalPerProduct --disable-settings-layers=SolutionPersonal --disable-settings-layers=ProjectPersonal
182182
- name: Upload output to artifacts
183183
uses: actions/upload-artifact@v5
184184
with:
@@ -199,7 +199,7 @@ jobs:
199199
$issueType = $xml.report.IssueTypes.SelectSingleNode("IssueType[@Id='$($_.TypeId)']")
200200
$severity = $_.Severity ?? $issueType.Severity
201201
202-
Write-Output "[$severity] $($_.File):$($_.Line) $($_.TypeId): $($_.Message)"
202+
Write-Output "[$severity] $($_.File) ($_.TargetFramework):$($_.Line) $($_.TypeId): $($_.Message)"
203203
})
204204
})
205205
}
@@ -238,6 +238,8 @@ jobs:
238238
run: dotnet tool restore
239239
- name: Restore packages
240240
run: dotnet restore /p:NuGetAudit=false
241+
- name: Build
242+
run: dotnet build --no-restore --configuration Release /p:RunAnalyzers=false
241243
- name: CleanupCode (on PR diff)
242244
if: ${{ github.event_name == 'pull_request' }}
243245
shell: pwsh
@@ -249,14 +251,14 @@ jobs:
249251
250252
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
251253
dotnet jb cleanupcode --version
252-
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
254+
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
253255
- name: CleanupCode (on branch)
254256
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
255257
shell: pwsh
256258
run: |
257259
Write-Output 'Running code cleanup on all files.'
258260
dotnet jb cleanupcode --version
259-
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN --fail-on-diff --print-diff
261+
dotnet regitlint -s $env:SOLUTION_FILE --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN --fail-on-diff --print-diff
260262
261263
publish:
262264
timeout-minutes: 60

JetBrainsInspectCodeTransform.xslt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<table style="width:100%">
2525
<tr>
2626
<th>File</th>
27+
<th>Target Framework</th>
2728
<th>Line Number</th>
2829
<th>Type</th>
2930
<th>Message</th>
@@ -33,6 +34,9 @@
3334
<td>
3435
<xsl:value-of select="@File"/>
3536
</td>
37+
<td>
38+
<xsl:value-of select="@TargetFramework"/>
39+
</td>
3640
<td>
3741
<xsl:value-of select="@Line"/>
3842
</td>

cleanupcode.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $PSNativeCommandUseErrorActionPreference = $true
1212

1313
dotnet tool restore
1414
dotnet restore /p:NuGetAudit=false
15+
dotnet build --no-restore --configuration Release /p:RunAnalyzers=false
1516

1617
$solutionFile = 'JsonApiDotNetCore.sln'
1718

@@ -22,16 +23,16 @@ if ($revision) {
2223
if ($baseCommitHash -eq $headCommitHash) {
2324
Write-Output "Running code cleanup on staged/unstaged files."
2425
dotnet jb cleanupcode --version
25-
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f staged,modified
26+
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f staged,modified
2627
}
2728
else {
2829
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash, including staged/unstaged files."
2930
dotnet jb cleanupcode --version
30-
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
31+
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
3132
}
3233
}
3334
else {
3435
Write-Output "Running code cleanup on all files."
3536
dotnet jb cleanupcode --version
36-
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN
37+
dotnet regitlint -s $solutionFile --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --no-updates --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --properties:NuGetAudit=false --jb --verbosity=WARN
3738
}

inspectcode.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbra
1111
$resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html')
1212

1313
dotnet jb inspectcode --version
14-
dotnet jb inspectcode $solutionFile --dotnetcoresdk=$(dotnet --version) --build --output="$outputPath" --format="xml" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --properties:RunAnalyzers=false --properties:NuGetAudit=false --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
14+
dotnet jb inspectcode $solutionFile --build --no-updates --dotnetcoresdk=$(dotnet --version) --output="$outputPath" --format="xml" --settings=WarningSeverities.DotSettings --properties:Configuration=Release --properties:RunAnalyzers=false --properties:NuGetAudit=false --severity=WARNING --verbosity=WARN --disable-settings-layers=GlobalAll --disable-settings-layers=GlobalPerProduct --disable-settings-layers=SolutionPersonal --disable-settings-layers=ProjectPersonal
1515

1616
[xml]$xml = Get-Content "$outputPath"
1717
if ($xml.report.Issues -and $xml.report.Issues.Project) {

0 commit comments

Comments
 (0)