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

Turn some code style rule severity from suggestion to warning #20680

Merged
merged 5 commits into from
Feb 27, 2023

Conversation

PunkPun
Copy link
Member

@PunkPun PunkPun commented Feb 19, 2023

Copy link
Member

@penev92 penev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

.editorconfig Outdated Show resolved Hide resolved
OpenRA.Game/Map/ActorInitializer.cs Show resolved Hide resolved
OpenRA.Mods.Common/Activities/RepairBridge.cs Show resolved Hide resolved
OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs Outdated Show resolved Hide resolved
.editorconfig Outdated Show resolved Hide resolved
RoosterDragon
RoosterDragon previously approved these changes Feb 20, 2023
OpenRA.Mods.Cnc/UtilityCommands/LegacyTilesetImporter.cs Outdated Show resolved Hide resolved
Comment on lines +254 to +256
#pragma warning disable IDE0047
(*op++) = *ip++;
#pragma warning restore IDE0047
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to disable this here? Are the parentheses not unnecessary but the warning still appears? Line 251 has the same? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try removing parenthesis. Something very weird is going on

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove the parenthesis rule SA1023 kicks in:

Dereference symbol '*' should not be preceded by a space. csharp(SA1023)

Comment on lines +72 to +74
#pragma warning disable IDE0047
(*(c + s * 256 + h)) = Color.FromAhsv(h / 255f, 1 - s / 255f, V).ToArgb();
#pragma warning restore IDE0047
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Also the outer for loop would need braces.

@@ -183,6 +183,9 @@ dotnet_diagnostic.CA1827.severity = warning
# Use Length/Count property instead of Enumerable.Count method.
dotnet_diagnostic.CA1829.severity = warning

# Use span-based 'string.Concat' (incompatible with mono builds).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe at least add a TODO here, reminding this should be enabled if/when we drop Mono?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mono is mentioned

Copy link
Member

@penev92 penev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@penev92 penev92 merged commit 4b3f703 into OpenRA:bleed Feb 27, 2023
@PunkPun PunkPun deleted the rules branch February 27, 2023 09:03
@penev92
Copy link
Member

penev92 commented Feb 27, 2023

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants