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

Investigate why CA1815 violations were not reported #12030

Open
Youssef1313 opened this issue Apr 21, 2023 · 8 comments
Open

Investigate why CA1815 violations were not reported #12030

Youssef1313 opened this issue Apr 21, 2023 · 8 comments
Labels
area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools

Comments

@Youssef1313
Copy link
Member

Youssef1313 commented Apr 21, 2023

Current behavior

There was few CA1815 violations (see #12029), but CI and local builds were green.

We already set that to error:

uno/.editorconfig

Lines 310 to 311 in bdd49d9

# CA1815: Override equals and operator equals on value types
dotnet_diagnostic.CA1815.severity = error

@Youssef1313 Youssef1313 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. area/build Categorizes an issue or PR as relevant to build infrastructure labels Apr 21, 2023
@Youssef1313
Copy link
Member Author

@mavasani Sorry for the ping, looking at binlog, it looks like everything is right on our end:

image

@Youssef1313
Copy link
Member Author

IntelliSense shows the error correctly, but not on build.

image

@sharwell
Copy link

@Youssef1313 Note that .globalconfig is the true replacement for ruleset files. I would generally recommend placing all of the dotnet_diagnostic.[id].severity lines in .globalconfig instead of .editorconfig.

Have you checked the value of SkipAnalyzers in the log?

@Youssef1313
Copy link
Member Author

@sharwell It's empty.

image

Yeah I'm planning to move to .globalconfig, but in this case .editorconfig is supposed to just work right?

@Youssef1313
Copy link
Member Author

@sharwell fyi this is still an issue with globalconfig and also updated NetAnalyzers package to 8.0.0-preview1.23165.1

@Youssef1313
Copy link
Member Author

I was able to root this down.

Most classes here have an auto-generated partial. When it happens that this is the first location of a symbol, the diagnostic isn't reported because the analyzer is configured to not report on generated code.

@MartinZikmund MartinZikmund added area/code-generation Categorizes an issue or PR as relevant to code generation difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Sep 11, 2023
@MartinZikmund
Copy link
Member

@Youssef1313 Weird behavior! It sounds like this is something that the .NET team should address though

@Youssef1313
Copy link
Member Author

Related Roslyn issue: dotnet/roslyn#69543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants