-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Enable IDE0044: MakeFieldReadonly #13880
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
Conversation
|
@xtqqczze Please resolve merge conflicts and rebase. |
|
@iSazonov We can reuse this PR for |
|
The PR is still huge. |
|
@iSazonov |
|
@xtqqczze Please look the code in .Net Runtime repository. Perhaps they already fixed the issues. If no we could suppress the warnings on file level: (For generated code https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-options#exclude-generated-code) |
src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs
Show resolved
Hide resolved
Co-authored-by: Paul Higinbotham <paulhi@microsoft.com>
requested by @PaulHigin
|
|
Doesn't this work?
|
@iSazonov Unless I specify the absolute path, I see warning |
|
Depends on #15704. |
absolute path? What about relative? I don't like the assembly level suppression and I'd consider it as only last resort. I believe we don't want ComInterop in separate project because we don't want new additional dll. |
It seems that section headers for global AnalyzerConfig files must specify an absolute file path. A relative file path produces a compiler warning and is ignored. |
Prosper-web
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
|
🎉 Handy links: |
Enable IDE0044: MakeFieldReadonly as warning.
ComInteropviaGlobalSuppressions.csstatic readonlyfields toconst.