Skip to content

Commit

Permalink
Analyzer usage (#2969)
Browse files Browse the repository at this point in the history
* Sample

* Fix?

* Always?

* forward slashes?

* Update F# analyzers.

* Remove code that yields warning.

* Restore build steps.

* Restore Benchmark.
  • Loading branch information
nojaf authored Oct 30, 2023
1 parent ee06697 commit 3f293e7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]
},
"fsharp-analyzers": {
"version": "0.17.0",
"version": "0.17.1",
"commands": [
"fsharp-analyzers"
]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: "trigger fantomas-tools action"
if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main'
run: "curl -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ${{secrets.FANTOMAS_TOOLS_TOKEN}}' --request POST --data '{\"event_type\": \"fantomas-commit-on-main\"}' https://api.github.com/repos/fsprojects/fantomas-tools/dispatches"
- name: "Run analyzers"
run: dotnet msbuild /t:AnalyzeSolution
continue-on-error: true
if: matrix.os == 'ubuntu-latest'
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
if: matrix.os == 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>
<Exec
ContinueOnError="true"
Command="dotnet fsharp-analyzers --fsc-args &quot;@(FscCommandLineArgs)&quot; --analyzers-path &quot;$(PkgG-Research_FSharp_Analyzers)\analyzers\dotnet\fs&quot; --exclude-analyzer PartialAppAnalyzer --fail-on-warnings GRA-STRING-001 GRA-STRING-002 GRA-STRING-003 GRA-UNIONCASE-001 --verbose --report &quot;../../analysisreports/$(MSBuildProjectName)-analysis.sarif&quot;">
Command="dotnet fsharp-analyzers --fsc-args &quot;@(FscCommandLineArgs)&quot; --analyzers-path &quot;$(PkgG-Research_FSharp_Analyzers)/analyzers/dotnet/fs&quot; --exclude-analyzer PartialAppAnalyzer --fail-on-warnings GRA-STRING-001 GRA-STRING-002 GRA-STRING-003 GRA-UNIONCASE-001 --verbose --report &quot;../../analysisreports/$(MSBuildProjectName)-analysis.sarif&quot;">
<Output TaskParameter="ExitCode" PropertyName="LastExitCode" />
</Exec>
<Error Condition="'$(LastExitCode)' == '-2'" Text="Problems were found $(MSBuildProjectFile)" />
Expand Down
4 changes: 0 additions & 4 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ pipeline "Build" {
}
stage "CheckFormat" { run "dotnet fantomas src docs build.fsx --check" }
stage "Build" { run "dotnet build -c Release" }
stage "Analyze" {
run (fun _ -> async { System.IO.Directory.CreateDirectory(analysisReportsDir) |> ignore })
run "dotnet msbuild /t:AnalyzeSolution"
}
stage "UnitTests" { run "dotnet test -c Release" }
stage "Pack" { run "dotnet pack --no-restore -c Release -o ./bin" }
stage "Docs" {
Expand Down

0 comments on commit 3f293e7

Please sign in to comment.