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

Report when the same analyzer is passed multiple times #62610

Closed
RikkiGibson opened this issue Jul 13, 2022 · 0 comments · Fixed by #63264
Closed

Report when the same analyzer is passed multiple times #62610

RikkiGibson opened this issue Jul 13, 2022 · 0 comments · Fixed by #63264
Assignees
Milestone

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Jul 13, 2022

In dotnet/wpf#6792 (comment) we found a scenario where the build was passing in the exact same analyzer multiple times.

When the same source file is passed multiple times, we give a warning and drop the duplicated file:

// warning CS2002: Source file '{0}' specified multiple times
diagnostics.Add(new DiagnosticInfo(MessageProvider, (int)ErrorCode.WRN_FileAlreadyIncluded,
Arguments.PrintFullPaths ? normalizedFilePath : _diagnosticFormatter.RelativizeNormalizedPath(normalizedFilePath)));
trees[i] = null;

Perhaps we should do something similar for analyzers.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 13, 2022
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 9, 2022
@jaredpar jaredpar added this to the 17.4 milestone Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants