1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 09:34:49 +09:00
Commit graph

56 commits

Author SHA1 Message Date
vsadov
0672c76a63 some improvements in concurrent dictionary 2025-05-12 23:40:21 -07:00
Mario Pistrich
83b0d939be
Fix CA2022 warnings (Avoid inexact read with 'Stream.Read') (#100352)
* Configure CA2022 severity

* Fix CA2022 warnings

* Check for NET7_0_OR_GREATER before using ReadExactly

* Fix CS1503

* Formatting

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
2024-03-28 17:05:34 -07:00
Stephen Toub
c659c6e511
Update CodeAnalysis config with recent rules (#100146) 2024-03-25 08:46:15 -04:00
Buyaa Namnan
c6906ae608
Update dependencies from dotnet/roslyn-analyzers, config new analyzers (#99343)
* Reapply "[main] Update dependencies from dotnet/roslyn-analyzers (#98984)" (#99327)

* Configure new analyzers severity in src and test projects

* Fix some of CA2263 warnings
2024-03-07 13:48:04 -08:00
Art Leonard
9c579f9bc5
Enable SA1136: Enum values should be on separate lines #94098 (#94100) 2023-10-31 11:59:38 +01:00
Miha Zupan
e235aeff6c
Set severity of rule CA1870 to warning (#92135)
* Set severity of rule CA1870 to warning

* Replace one more usage in nativeaot corelib

* Set severity for tests as well

* pragma disable the rule in nativeaot's reflection impl
2023-09-20 08:45:31 -07:00
David Cantú
6504cdb355
Enable rule CA1869 - Cache and reuse 'JsonSerializerOptions' (#90895)
* Enable rule CA1869

* Fix ocurrences in src/tasks projects

* Fix more occurrences on installer and mono\wasm
2023-09-11 12:53:49 -05:00
Stephen Toub
7d399f6dee
Enable analyzer analyzers (#91733)
Use Microsoft.CodeAnalysis.Analyzer in our builds, to help validate our analyzers and source generators. A few projects were doing this explicitly; this does it for all.
2023-09-08 10:08:48 -04:00
Eric StJohn
7bc9f6bd96
Make Analyzer crashes a warning (#90358)
* Make Analyzer crashes a warning

* Suppress AD0001 where it fails

* Suppress AD0001 in other CoreLibs
2023-08-11 06:27:06 -07:00
dotnet-maestro[bot]
8917ca24d6
[main] Update dependencies from dotnet/roslyn-analyzers (#89630)
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230727.4
---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
2023-08-07 09:57:11 -07:00
Mario Pistrich
4ed355098d
Enable new analyzer CA1868: 'Unnecessary call to 'Contains' for sets' and fix findings (#89652) 2023-07-29 09:41:35 +02:00
Stephen Toub
023b54a2d4
Enable CA1863 (Use 'CompositeFormat') as suggestion (#89029)
I ran it over runtime, and the only things flagged were for exceptional cases where it's not worth using.  Rather than a bunch of suppressions, I'm just enabling it as info-level.
2023-07-17 16:52:57 -04:00
Buyaa Namnan
9409e2d501
Enable new analyzers CA1862, CA1864 in runtime and fix findings. (#88700)
* Enable new analyzers CA1862, CA1864 in runtime and fix findings
2023-07-13 19:57:02 -07:00
dotnet-maestro[bot]
54cb57399d
[main] Update dependencies from dotnet/roslyn-analyzers (#87768)
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230618.1

* Suppress RS1038 analyzer

* Fix new failures found with CA1859 analyzer updates

* Disable CA2261 on test projects, fix more CA1859 findings

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
2023-07-10 13:38:41 -07:00
Buyaa Namnan
5e67657e20
Fix warnings found with CA1861 Avoid constant arrays as arguments (#86229)
* Fix warnings found with CA1861

* Update src/coreclr/tools/aot/ILCompiler/Program.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

* Remove supression from static field

* Revert using string.Split(char)

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
2023-05-31 14:01:01 -07:00
Stephen Toub
ba777a8ba4
Update CodeAnalysis.src.globalconfig (#84059)
- Update the names of rules to match the current ones defined in NetAnalyzers
- Add a few more IDE rules, including enabling `IDE0280 Use nameof`
2023-04-15 16:59:41 -04:00
Buyaa Namnan
e26e33f98a
Add CA 2021 into CodeAnalysis config (#82649) 2023-02-24 17:25:26 -08:00
Buyaa Namnan
6450398d88
Fix warnings found with new analyzer CA1860: Prefer Length/Count/IsEmpty property check over Any() (#81583)
Co-authored-by: Marek Safar <marek.safar@gmail.com>
2023-02-07 13:59:20 +01:00
Marek Safar
4b5029c808
Enable CA1859 - Use concrete types when possible for improved performance (#80848) 2023-01-31 14:46:51 +01:00
Stephen Toub
fb7d8b186b
Add SYSLIB* analyzers to global configs (#80930)
* Add SYSLIB* analyzers to global configs

* Address PR feedback
2023-01-26 08:25:39 -05:00
Stephen Toub
699acfac91
Enable new analyzers CA1510/11/12/13 and CA1856/57/58 (#80149)
* Enable new analyzers CA1510/11/12/13 and CA1856/57/58

CA1510: Use ArgumentNullException throw helper
CA1511: Use ArgumentException throw helper
CA1512: Use ArgumentOutOfRangeException throw helper
CA1513: Use ObjectDisposedException throw helper
CA1856: Incorrect usage of ConstantExpected attribute
CA1857: A constant is expected for the parameter
CA1858: Use 'StartsWith' instead of 'IndexOf'

* More fixes

* Address PR feedback
2023-01-07 15:48:01 -05:00
Marek Safar
8918adf2e5
Enable IDE0060 (Remove unused parameter) analyzer (#72667) 2022-11-08 14:05:34 +01:00
Stephen Toub
c0d2dda671
Update globalconfigs with recently added rules (#77538)
* Update globalconfigs with recently added rules

* Fix Fill(0) to Clear() in NTAuthentication
2022-10-28 17:19:53 -04:00
Buyaa Namnan
691cf0f448
Fix numeric IntPtr behavioral changes analyzer findings (#75557)
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
2022-10-04 17:26:05 -07:00
Adeel Mujahid
9d6396deb0
Fix typos (#72709) 2022-07-23 20:24:28 -07:00
Eric Erhardt
e5899962f5
Enable CA1727: Use PascalCase for named placeholders (#71444)
* Enable CA1727: Use PascalCase for named placeholders

Also CA2253: Named placeholders should not be numeric values

* Fix MonoProxy logging placeholder names
2022-06-30 22:54:16 -05:00
Stephen Toub
9f7bf79991
Enable IDE0170 (Simplify property pattern) and IDE0200 (remove unnecessary lambda expression) (#71011)
As part of updating the config file with recently added rules, also turn on a few of them.
2022-06-28 14:46:45 -04:00
Stephen Toub
de170cc1c1
Enable IDE0031 (Use null propagation) (#70965) 2022-06-20 05:47:48 -04:00
Stephen Toub
566de97e58
Enable IDE0030 (Use coalesce expression) (#70948) 2022-06-19 09:08:59 -04:00
Stephen Toub
7a039ffb3e
Update C# compiler (#70947)
Brings in support for required members
2022-06-19 07:52:45 -04:00
Stephen Toub
246d9bb4fa
Enable IDE0065 (Misplaced using directive) (#70919) 2022-06-18 21:44:31 -07:00
Stephen Toub
8442a62336
Enable IDE0100 (Remove redundant equality) (#70896) 2022-06-18 21:43:37 -07:00
Stephen Toub
656f909fb0
Enable IDE0071 (Simplify interpolation) (#70918) 2022-06-18 21:41:30 -07:00
Stephen Toub
3fdee96874
Enable IDE0020 (Use pattern matching) (#70523)
* Enable IDE0020 (Use pattern matching)

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs

Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>

* Update variable naming

Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
2022-06-17 08:11:32 -04:00
Stephen Toub
a796755292
Enable IDE0054 (Use compound assignment) (#70564)
* Enable IDE0054 (Use compound assignment)

* Update src/libraries/System.Data.Common/src/System/Data/Common/StringStorage.cs

Co-authored-by: Tanner Gooding <tagoo@outlook.com>

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
2022-06-17 05:26:03 -04:00
Stephen Toub
502f9acc71
Enable IDE1005 (Delegate invocation can be simplified) (#70522) 2022-06-16 16:57:36 -04:00
Stephen Toub
d84115f52f
Enable IDE0029 (Use coalesce expression) (#70506)
* Enable IDE0029 (Use coalesce expression)

* Address PR feedback and a few missed cases
2022-06-10 09:33:19 -04:00
Stephen Toub
d6e8686e56
Enable IDE0036 (Modifers are not ordered) (#70502) 2022-06-10 06:45:48 -04:00
Buyaa Namnan
61ca87cb48
Update analyzer version and fix new findings (#70157) 2022-06-09 15:25:37 -07:00
Stephen Toub
daffba6b2d
Enable IDE0110 (Remove unnecessary discard) (#70500) 2022-06-09 16:09:33 -04:00
Stephen Toub
76b5b76ceb
Enable IDE0074 (Use compound assignment) (#70402) 2022-06-08 21:23:35 -07:00
Stephen Toub
71a73fb24c
Update Microsoft.CodeAnalysis.NetAnalyzers version (#68724)
- Delete some now unnecessary pragmas
- Enable the new Dictionary.ContainsKey guard rule
- Address on violation of the new rule
2022-05-01 06:22:11 -04:00
Stephen Toub
46871b8541
Enable new CA1311 (ToLower/Upper culture) and CA1852 (seal internal/private types) rules (#68268)
* Enable new CA1311 (ToLower/Upper culture) and CA1852 (seal internal/private types)

CA1311 flagged a few issues, all addressed by using ToLowerInvariant/ToUpperInvariant.

CA1852 flagged a bunch that previous cleanups around sealing types missed or that are new since.  Sealing types then highlighted places where protected or virtual members were being exposed unnecessarily, so those were fixed, too.  Adding sealed to things also highlighted some discrepancies in the order of "unsafe sealed" keywords, where the vast majority in the repo were "sealed unsafe", so I fixed the few that weren't.

* Address PR feedback and fix more CI failures

* Fix unit test build error
2022-04-21 16:22:53 -04:00
Stephen Toub
215b39abf9
Remove usage of !! from dotnet/runtime (#68178)
* Remove usage of !! from dotnet/runtime

- Use ArgumentNullException.ThrowIfNull instead where possible.  It's only usable for projects that only target .NET 6+, and it can't be used in places like this(...) or base(...).
- In other cases, if the project already has a ThrowHelper, augment it for null as needed and use that.
- For most of the extensions projects, add a ThrowHelper.ThrowIfNull that replicates ArgumentNullException.ThrowIfNull.
- For everything else, just use "throw new".

* Address PR feedback

* Address PR feedback

* Remove false positives from searches

* Address PR feedback
2022-04-21 13:25:52 -04:00
Tanner Gooding
7c21927c25
Updating generic math to support user-defined checked operators (#67714)
* Uncomment the user-defined checked operators for generic math

* Change SA1000 to be a suggestion until https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3478 can be resolved

* Regenerating the System.Runtime ref assembly

* Adding tests covering user-defined checked operators in generic math

* Remove the checked() context from integer division, since there is no behavioral difference on .NET

* Ensure the doc comments around user-defined checked operators are uncommented

* Fix some doc comments that shouldn't have been uncommented yet
2022-04-08 00:07:28 -07:00
Stephen Toub
b2e494c6ba
Enable recently added analyzers (and fix some violations) (#67292) 2022-03-30 06:55:28 -04:00
Marek Safar
6a889d2342
Enable CA1822 (Mark members as static) analyzer (#66333) 2022-03-25 12:06:33 +01:00
Marek Safar
47bcd1a8b0
Remove unused private parameters in SPC (#63015) 2022-02-12 18:44:41 +01:00
Stephen Toub
3ae87395f6
Initial roll out of !! (#64720)
* Bump version of C# compiler

This should be reverted when arcade brings in a new enough compiler.

* Fix a few new warnings from updating compiler

* Enable IDE0190 to employ parameter null checking

* Initial roll out of !!

* Fix more compiler warnings from upgrade, plus some test fixes / reverts

* Fix a few more tests

* Disable profiling test
2022-02-08 16:06:59 -05:00
Stephen Toub
0ac0071e45
Implement IEquatable<T> on value types overriding Equals (and enable CA1066/1077) (#63690) 2022-01-24 09:43:25 -05:00