G-Research / fsharp-analyzers

Analyzers for F#
https://g-research.github.io/fsharp-analyzers/
Apache License 2.0
14 stars 1 forks source link

Support request: what's wrong with my invocation? #48

Closed Smaug123 closed 11 months ago

Smaug123 commented 11 months ago

Here's the complete log of a failed run, which happens consistently in my pipeline:

Run dotnet fsharp-analyzers --project ./WoofWare.Myriad.Plugins/WoofWare.Myriad.Plugins.fsproj --analyzers-path ./.analyzerpackages/g-research.fsharp.analyzers/0.6.0/ --verbosity detailed --report ./analysis.sarif --treat-as-error GRA-STRING-001 GRA-STRING-002 GRA-STRING-003 GRA-UNIONCASE-001 GRA-INTERPOLATED-001 GRA-TYPE-ANNOTATE-001 GRA-VIRTUALCALL-001 GRA-IMMUTABLECOLLECTIONEQUALITY-001 GRA-JSONOPTS-001 GRA-LOGARGFUNCFULLAPP-001

info: Running in verbose mode
info: Treat as Hints: []
info: Treat as Info: []
info: Treat as Warning: []
info: Treat as Error: [GRA-IMMUTABLECOLLECTIONEQUALITY-001, GRA-INTERPOLATED-001, GRA-JSONOPTS-001, GRA-LOGARGFUNCFULLAPP-001, GRA-STRING-001, GRA-STRING-002, GRA-STRING-003, GRA-TYPE-ANNOTATE-001, GRA-UNIONCASE-001, GRA-VIRTUALCALL-001]
info: Ignore Files: []
info: Loading analyzers from /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/.analyzerpackages/g-research.fsharp.analyzers/0.6.0/
info: Registered 11 analyzers from 1 dlls
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/obj/Debug/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.fs aborted
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/obj/Debug/net6.0/WoofWare.Myriad.Plugins.AssemblyInfo.fs aborted
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/AstHelper.fs aborted
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/SynExpr.fs aborted
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/SynAttribute.fs aborted
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/RemoveOptionsGenerator.fs aborted
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/JsonParseGenerator.fs aborted
error: Checking of file /home/runner/work/WoofWare.Myriad/WoofWare.Myriad/WoofWare.Myriad.Plugins/HttpClientGenerator.fs aborted

The pipeline I linked uses Nix to obtain the global tool, but the log above is from a branch with mere dotnet tool restore && dotnet fsharp-analyzers (complete failing run).

I have been intermittently able to reproduce this locally, but never with a source build of fsharp-analyzers.

nojaf commented 11 months ago

Hi Patrick,

Interesting find, I'm not quite sure but at first glance, I would expect the type-checking of the project to go wrong. Did you restore (and/or build) the project before running the analyzers?

Smaug123 commented 11 months ago

Ah, running a build of the project to be analysed does appear to consistently fix the problem, thanks. I was confused by the fact that a source build of fsharp-analyzers doesn't exhibit the failure, but also doesn't pick up any analysis failures until I do a manual rebuild.