GeezerVison is showing github.com — Enable IDE0044: MakeFieldReadonly by xtqqczze · Pull Request #13880 · PowerShell/PowerShell
Conversation
xtqqczze
commented
Oct 26, 2020
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Enable IDE0044: MakeFieldReadonly as warning.
- Add suppression for
ComInterop via GlobalSuppressions.cs
- Convert a few
static readonly fields to const.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 26, 2020
|
xtqqczze Please resolve merge conflicts and rebase.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
xtqqczze
changed the title
Enable IDE0044: MakeFieldReadonly
Enable IDE0044: MakeFieldReadonly part 11
Nov 2, 2020
|
Ilya (@iSazonov) We can reuse this PR for src\Microsoft.Management.Automation changes?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
xtqqczze
changed the title
Enable IDE0044: MakeFieldReadonly part 11
Enable IDE0044: MakeFieldReadonly
Nov 2, 2020
This was referenced Nov 2, 2020
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ghost
added
Waiting on Author
The PR was reviewed and requires changes or comments from the author before being accept
and removed
Waiting on Author
The PR was reviewed and requires changes or comments from the author before being accept
labels
Jun 28, 2021
|
/home/vsts/work/1/s/src/System.Management.Automation/engine/interpreter/InstructionList.cs(99,49): error CS0649: Field 'InstructionList._debugCookies' is never assigned to, and will always have its default value null [/home/vsts/work/1/s/src/System.Management.Automation/System.Management.Automation.csproj]
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Ilya (iSazonov)
commented
Jun 29, 2021
•
edited by unfurl-links
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
xtqqczze
commented
Jun 30, 2021
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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:
[ExcepInfo.cs]
dotnet_diagnostic.IDE0044.severity = none
(For generated code https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-options#exclude-generated-code)
Doesn't this work?
Ilya (@iSazonov) Unless I specify the absolute path, I see warning InvalidGlobalSectionName, so probably this approach doesn't work in a GlobalConfig file. In any case, suppression in a GlobalSuppressions.cs file works for this PR. Ideally, the ComInterop code would be split to separate project and we set RunAnalyzers to false in the csproj. We could open an issue to discuss the best approach.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Ilya (@iSazonov) Unless I specify the absolute path, I see warning InvalidGlobalSectionName, so probably this approach doesn't work in a GlobalConfig file. In any case, suppression in a GlobalSuppressions.cs file works for this PR. Ideally, the ComInterop code would be split to separate project and we set RunAnalyzers to false in the csproj. We could open an issue to discuss the best approach.
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.
|
PaulHigin reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Ilya (@iSazonov) Unless I specify the absolute path, I see warning InvalidGlobalSectionName, so probably this approach doesn't work in a GlobalConfig file. In any case, suppression in a GlobalSuppressions.cs file works for this PR. Ideally, the ComInterop code would be split to separate project and we set RunAnalyzers to false in the csproj. We could open an issue to discuss the best approach.
absolute path? What about relative?
I don't like the assembly level suppression and I'd consider it as only last resort.
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🎉v7.2.0-preview.8 has been released which incorporates this pull request.:tada:
Handy links:
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
+2 more reviewers
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Labels
CL-CodeCleanup
Indicates that a PR should be marked as a Code Cleanup change in the Change Log
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|