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

Expected behavior of fsharp-analyzers when analyzing a project that depends on other local projects? #214

Closed
Numpsy opened this issue Jul 21, 2024 · 3 comments

Comments

@Numpsy
Copy link
Contributor

Numpsy commented Jul 21, 2024

When I updated the fsharp-analyzers cli tool in a solution that has multiple projects from version 0.25.0 to 0.26.0, i noticed that I had a number of duplicated analyzer warnings/suggestions in my CI build.

Testing the tool, it appears that If I have

library.fsproj (shared library project)
console.fsproj (has a project reference to library.fsproj)

and I run

dotnet fsharp-analyzers --project console.fsproj ...

then it will check all the source files in both library.fsproj and console.fsproj, and output any suggestions from library.fsproj in the results.

As my CI build is running the analyzers against every project in the solution, it appears that some librarys are getting analyed multiple times, so I get duplicated suggestions.

This doesn't happen with version 0.25.0 of the cli tool, just 0.26.0 -> so I'm wondering if this is the expected behavior now?
(It sounds like something that might have been changed by #210, but the release notes don't mention a behavior change, so)

@nojaf
Copy link
Contributor

nojaf commented Aug 5, 2024

Hi, it could very well be that dependent projects are implicitly analyzed.
Thus leading to duplicate projects being analyzed.
I'm not quite sure here, @TheAngryByrd I think you improved something in the project cracking side of things that may now lead to this behavior. Any thoughts?

@TheAngryByrd
Copy link
Member

Oh yeah the use case here is to only run against one project, we should probably filter the list of loadedProjects to the list only passed in via the CLI.

@Numpsy
Copy link
Contributor Author

Numpsy commented Aug 6, 2024

Ok, the duplication I was seeing seems ok now in the 0.26.1 release

@Numpsy Numpsy closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants