Commit Graph

157 Commits

Author SHA1 Message Date
RoosterDragon
0b01b73111 Fix IDE0060 2023-02-28 21:21:40 +02:00
RoosterDragon
555aac3f64 Fix IDE0042 2023-02-28 21:21:40 +02:00
RoosterDragon
5b70d344cc Fix IDE0038 2023-02-28 21:21:40 +02:00
RoosterDragon
71ce515d6d Fix IDE0004 2023-02-28 21:21:40 +02:00
RoosterDragon
d4135d608e Fix IDE0039 2023-02-27 10:09:11 +01:00
Gustas
4b3f7034b2 Silence rule "Use span-based 'string.Concat'" 2023-02-27 08:36:47 +02:00
Gustas
8d0fe52dd8 Remove unnecessary parentheses 2023-02-27 08:36:47 +02:00
Gustas
157d1b32dc Use null propagation 2023-02-27 08:36:47 +02:00
Gustas
b06cbd7a95 Add missing punctuation to editorconfig 2023-02-27 08:36:47 +02:00
RoosterDragon
5a2a448c32 Fix IDE0250 2023-02-24 22:00:25 +02:00
RoosterDragon
5e52d067c8 Fix IDE0180 2023-02-24 22:00:25 +02:00
RoosterDragon
bf960b6eae Fix IDE0120 2023-02-24 22:00:25 +02:00
RoosterDragon
ede5412526 Fix IDE0100 2023-02-24 22:00:25 +02:00
RoosterDragon
78c41b84a1 Fix IDE0082 2023-02-24 22:00:25 +02:00
RoosterDragon
99c289e063 Fix IDE0075 2023-02-24 22:00:25 +02:00
RoosterDragon
3402031399 Fix IDE0071 2023-02-24 22:00:25 +02:00
RoosterDragon
837c70f857 Fix IDE0061 2023-02-24 22:00:25 +02:00
RoosterDragon
4f6095c3d4 Fix IDE0054 2023-02-24 22:00:25 +02:00
RoosterDragon
2d4119e88d Fix IDE0051 2023-02-24 22:00:25 +02:00
RoosterDragon
4991f2f892 Fix IDE0041 2023-02-24 22:00:25 +02:00
RoosterDragon
10def52ad9 Fix IDE0033 2023-02-24 22:00:25 +02:00
RoosterDragon
99c1a4448b Fix IDE0030 2023-02-24 22:00:25 +02:00
RoosterDragon
8223161959 Fix IDE0029 2023-02-24 22:00:25 +02:00
RoosterDragon
67ba3e55de Fix IDE0020 2023-02-24 22:00:25 +02:00
RoosterDragon
6d7c73d498 Fix IDE0019 2023-02-24 22:00:25 +02:00
RoosterDragon
80bb828fe5 Fix IDE0018 2023-02-24 22:00:25 +02:00
RoosterDragon
b0dca05e50 Fix IDE0002 2023-02-24 22:00:25 +02:00
RoosterDragon
8b4500146f Fix IDE0001 2023-02-24 22:00:25 +02:00
Matthias Mailänder
19ecddcd86 Enforce use of 'var' instead of explicit type. 2022-12-28 23:02:04 +01:00
Gustas
858d782af1 Simplify 'default' expression (IDE0034) 2022-10-11 17:40:05 +02:00
Matthias Mailänder
6bd631618c Remove unnecessary value assignment (IDE0059) 2022-10-01 14:15:33 +03:00
Matthias Mailänder
d3a8b07f05 Remove unread private member (IDE0052) 2022-09-13 10:36:57 +03:00
Matthias Mailänder
fb5624880b Fix sorting. 2022-09-06 20:52:04 +03:00
Matthias Mailänder
67aa0cdede Avoid Count() when Any() could be used (CA1827) 2022-09-06 20:52:04 +03:00
Matthias Mailänder
7ba6a49378 Avoid using LINQ on indexable collections (CA1826) 2022-09-06 18:02:39 +02:00
Eduardo Cáceres
a1811b4b04 Add fixed issues as warnings to .editorconfig 2022-05-18 11:42:36 -05:00
Matthias Mailänder
af3362c62f Use string.Contains(char) instead of string.Contains(string)
with single characters
2022-04-13 20:09:57 +02:00
Matthias Mailänder
0e7ad43425 Remove unused parameters. 2022-04-01 23:30:26 +02:00
RoosterDragon
9cd55df584 Ensure editorconfig naming styles align with StyleCop SA13XX style rules.
Aligns the naming conventions defined in editorconfig (dotnet_naming_style, dotnet_naming_symbols, dotnet_naming_rule) which are reported under the IDE1006 rule with the existing StyleCop rules from the SA13XX range.

This ensures the two rulesets agree when rejecting and accepting naming conventions within the IDE, with a few edges cases where only one ruleset can enforce the convention. IDE1006 allows use to specify a naming convention for type parameters, const locals and protected readonly fields which SA13XX cannot enforce. Some StyleCop SA13XX rules such as SA1309 'Field names should not begin with underscore' are not possible to enforce with the naming rules of IDE1006.

Therefore we enable the IDE1006 as a build time warning to enforce conventions and extend them. We disable SA13XX rules that can now be covered by IDE1006 to avoid double-reporting but leave the remaining SA13XX rules that cover additional cases enabled.

We also re-enable the SA1311 rule convention but enforce it via IDE1006, requiring some violations to be fixed or duplication of existing suppressions. Most violations fixes are trivial renames with the following exception. In ActorInitializer.cs, we prefer to make the fields private instead. ValueActorInit provides a publicly accessible property for access and OwnerInit provides a publicly accessible method. Health.cs is adjusted to access the property base instead when overriding. The reflection calls must be adjusted to target the base class specifically, as searching for a private field from the derived class will fail to locate it on the base class.

Unused suppressions were removed.
2022-02-07 19:14:45 +01:00
penev92
9cc631ca7e Added a rule about using object initializers 2022-01-23 13:14:57 +01:00
penev92
70e2769a85 Added a rule about the readonly modifier
Also added a rule to silence StyleCop complaining about StaticReadonlyFieldsMustBeginWithUpperCaseLetter to match what we already have configured for the IDE.
2022-01-22 18:47:06 +00:00
penev92
a67cfabd1e Reordered code style rules
To order them by their number.
2022-01-20 22:10:28 +01:00
penev92
8dbaa0c49f Added more explanations to .editorconfig 2022-01-20 22:10:28 +01:00
penev92
92d1d64dce Changed one-liner braces rule to silent
Having this set to "none" disabled the IDE's option to add braces, whereas "silent" lets it do it on the user's request while still not suggesting it on its own.
2022-01-20 22:10:28 +01:00
penev92
31b3647c09 Added a rule about unordered modifiers 2022-01-20 22:10:28 +01:00
penev92
3bacd81b8b Added a rule about zero-length array allocations 2022-01-20 22:10:28 +01:00
penev92
19dd23e349 Beautified the .editorconfig file 2022-01-19 14:37:14 +01:00
penev92
b67954451a Removed obsolete file OpenRA.sln.DotSettings
- The DEFAULT_PRIVATE_MODIFIER behaviour is now handled by the .editorconfig file via `dotnet_style_require_accessibility_modifiers = omit_if_default:warning`.
 Also added `dotnet_diagnostic.IDE0040.severity = warning` there to raise compile-time errors in the CI.
 - The field naming conventions seem to already be covered by (some) analyzer rules (checked in both VS and VSCode) - IDE1006/SA1306 and SA1307.
2022-01-09 18:58:37 +01:00
Matthias Mailänder
590ab88c45 Don't prefer braces (for one liners). 2021-04-03 10:53:08 +02:00
teinarss
b486112c98 Fix broken editorconfig 2021-01-16 22:28:17 +01:00