Enable IDE0044: MakeFieldReadonly#13880
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. |
|
🎉 Handy links: |
Enable IDE0044: MakeFieldReadonly as warning.
ComInteropviaGlobalSuppressions.csstatic readonlyfields toconst.