Commit Graph

79 Commits

Author SHA1 Message Date
Morilli 4c00ec54e7 Bump AnalysisLevel, remove legacy rules 2023-08-14 14:18:45 -07:00
YoshiRulz 4a752f66b7
Add Analyzer to require checking or discarding `TryGetValue`
I'm pretty sure all the existing instances were intended to use `default(T)` if
the key isn't present, except maybe the cheatcode converters but I don't care to
rewrite those at the moment
2023-05-05 06:27:15 +10:00
YoshiRulz 8a5921182e
Add Analyzer to disallow discarding locals e.g. `_ = result;`
fixes 70bd081a9, a2185d9ef
2023-04-29 01:52:43 +10:00
YoshiRulz fa48278354
Enable MEN014 and fix noncompliance
"Prefer TryGetValue"
2023-04-27 17:24:55 +10:00
YoshiRulz 23b571eac9
Disable code style analysis rule MEN010
"Avoid magic numbers"
2023-04-18 16:28:49 +10:00
YoshiRulz a1fe557d31
Re-enable MA0020 and fix noncompliance 2023-04-16 09:02:40 +10:00
YoshiRulz 65ffa3fc2e
Blindly update NuGet deps
temporarily disabled MA0020
2023-04-16 09:02:40 +10:00
YoshiRulz 1b5ec471e0
Disable SA1015 "Closing generic bracket should be followed by a space" 2022-11-05 09:10:11 +10:00
YoshiRulz a5a68af3f9
Disable MEN007 "Use a single return" 2022-08-17 17:35:06 +10:00
YoshiRulz a5652ee3bc
Backport `IEnumerable.Order`/`OrderDescending` shorthand
at time of writing, in .NET 7 preview
https://github.com/dotnet/runtime/pull/70525
2022-08-13 02:18:26 +10:00
YoshiRulz 140e340a8d
Add Analyzer rule to warn of `FirstOrDefault` on list of structs 2022-07-28 03:06:01 +10:00
YoshiRulz 0f6e6a5a03
Enable MA0084 and fix noncompliance (except in Cores)
"Local variable should not hide other symbols"
2022-07-22 07:28:32 +10:00
YoshiRulz d142555ec3
Enable MA0066 and fix noncompliance
"Hash table unfriendly type is used in a hash table"
2022-07-22 07:28:31 +10:00
YoshiRulz 41d46dd37d
Fix `%recent%` in Paths config
broken since introduction in 017743133 (pre-1.0 according to GitHub)
also enabled MA0052 "Replace constant Enum.ToString with nameof", which is what
tipped me off to this
2022-07-22 07:28:25 +10:00
YoshiRulz 0309cdc4bc
Disable MEN015 "Use Preferred Terms" (spellcheck)
you're supposed to be able to configure this but I couldn't figure it out
2022-07-22 05:39:03 +10:00
YoshiRulz 17df5673d2
Enable MA0098 and fix noncompliance
"Use indexer instead of LINQ methods"
2022-07-22 03:51:47 +10:00
YoshiRulz ee11385f10
Enable MA0031 and fix noncompliance
"Optimize Enumerable.Count() usage"
2022-07-22 03:51:47 +10:00
YoshiRulz b1ad34839a
Enable MA0029 and fix noncompliance
"Combine LINQ methods"
2022-07-22 03:51:47 +10:00
YoshiRulz 26b6a1c4a9
Enable MA0020 and fix noncompliance
"Use direct methods instead of LINQ methods"
2022-07-22 03:51:47 +10:00
YoshiRulz 697c10e3e6
Enable MA0015 and fix noncompliance
"Specify the parameter name in ArgumentException"
needed to update package because this rule was broken until now
2022-07-22 03:51:46 +10:00
YoshiRulz 92c4714be1
Enable CA2208 and MA0043 and fix noncompliance
"Instantiate argument exceptions correctly" and
"Use nameof operator in ArgumentException"
2022-07-22 03:51:45 +10:00
YoshiRulz 5a8a24e936
Enable MA0054 and fix noncompliance
"Embed the caught exception as innerException"
2022-07-22 03:51:43 +10:00
YoshiRulz 8ac4dabaf7
Enable MA0012 and MA0014 and fix noncompliance
"Do not raise reserved exception type" and
"Do not raise System.ApplicationException type"
now mostly compliant with
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/using-standard-exception-types
2022-07-22 03:51:43 +10:00
YoshiRulz a2fef59fe1
Add Analyzer rule to prohibit `typeof(T).ToString()` 2022-07-22 03:51:43 +10:00
YoshiRulz f3f90a4cd5
Add Analyzer rules to prohibit `this.GetType()`
seriously Meziantou is a godsend
2022-07-22 03:51:42 +10:00
YoshiRulz 3fddcdb2c5
Add Analyzer rule to enforce throwing in `[FeatureNotImplemented]` 2022-07-15 22:22:28 +10:00
YoshiRulz 6b4e526a44
Actually run all the Analyzers for ext. tools, update Analyzers
fixes 6f372820a
2022-07-15 22:22:19 +10:00
YoshiRulz 5379de9a6e
Enable MA0019 and fix noncompliance
"Use EventArgs.Empty" (instead of ctor)
2022-07-15 09:34:52 +10:00
YoshiRulz 4f98733c29
Add Analyzer to enforce exception type for default switch branches 2022-07-14 23:46:34 +10:00
YoshiRulz a7db24490c
Enable BHI1002 and fix noncompliance
"Do not use anonymous types (classes)"
2022-07-14 04:26:28 +10:00
YoshiRulz 056db314d4
Enable BHI1001 and fix noncompliance
"Do not use anonymous delegates"
2022-07-14 04:26:27 +10:00
YoshiRulz 395aa0755b
Add `BizHawk.Analyzer` project 2022-07-14 04:26:27 +10:00
YoshiRulz 0405e6399d
Add `Meziantou.Analyzers` NuGet package 2022-07-14 04:26:27 +10:00
YoshiRulz 7bd74f1004
Enable SA1133 and fix noncompliance
multiple attributes applied in one expression
2022-03-08 15:52:40 +10:00
YoshiRulz c1a7556d7f
Enable SA1129 and fix noncompliance (except in Cores)
calling implicit default struct ctor
2022-03-08 15:52:40 +10:00
YoshiRulz 8c4ceccab9
Enable CA1825 and fix noncompliance (except in Cores)
`new int[0]` and similar
2022-03-08 15:52:40 +10:00
YoshiRulz 33a487452d
Enable CA1806 and fix noncompliance (except in Cores)
return value implicitly discarded
2022-03-08 15:52:38 +10:00
YoshiRulz d8ce0e6177
Enable CA1064 and fix noncompliance
Exception classes should be public
2022-03-08 15:52:38 +10:00
YoshiRulz 191f1f3020
Enable CA1044 and fix noncompliance
getters with lower visibility than setters, or set-only props
2022-03-08 15:52:37 +10:00
YoshiRulz dd455580d6
Enable some more Analyzer rules 2022-03-08 15:52:29 +10:00
YoshiRulz 04bf9d0ec2
Fix code style and increase SA1121 level to error 2021-08-02 19:17:31 +10:00
YoshiRulz 99260d2746
Add DocumentationAnalyzers from NuGet and fix syntax in docs 2021-07-27 14:53:04 +10:00
YoshiRulz 928ea057d8
Enable SA1137 and fix noncompliance (except in Cores)
"Elements should have the same indentation"
2020-11-30 21:36:48 +10:00
YoshiRulz 44fb9fa368
Enable SA1211
"Using alias directives should be ordered alphabetically by alias name"
2020-11-30 21:27:52 +10:00
YoshiRulz be36c60e9e
Enable SA1208 and fix noncompliance (except in Cores)
"System using directives should be placed before other using directives"
2020-11-30 21:26:36 +10:00
YoshiRulz 251d3f91df
Make omitting access modifiers (SA1400) an error 2020-10-01 22:41:35 +10:00
YoshiRulz bf3f037bd7
Enable SA1212 and fix non-compliance
"Property accessors should follow order" (setter should not come before getter)
2020-09-08 22:23:10 +10:00
YoshiRulz 0dd89de0d8
Enable SA1205 and fix non-compliance (except in Cores)
"Partial elements should declare access" (type decl. modifier not copied across
all parts)
2020-09-08 22:14:47 +10:00
YoshiRulz 5488c80f4d
Enable SA1400 and fix noncompliance (except in Cores)
"Access modifier should be declared"
2020-09-08 21:57:14 +10:00
YoshiRulz 17ff66c61b
Opt-in to .NET 5 SDK's extra static analysis, update Analyzer packages
the extra CSxxxx rules should be available for Framework too if using the new
SDK, I haven't tried
2020-08-29 00:51:34 +10:00