Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
5668 commits
Select commit Hold shift + click to select a range
3f7c09d
Merge pull request #6794 from mavasani/CA1508_Enums
mavasani Jul 25, 2023
0c78dda
PR comments.
CollinAlpert Jul 25, 2023
2ede32c
Merge branch 'master' into issue_336
CollinAlpert Jul 25, 2023
8233ef8
Update RulesMissingDocumentation.md
CollinAlpert Jul 25, 2023
20c4d3f
Bail out from conversion inference for user-defined conversions
mavasani Jul 26, 2023
62b7d16
Merge pull request #6803 from mavasani/UserDefinedConversion_CA1508
mavasani Jul 26, 2023
7c759da
Fix CA1508 false positive for pattern expressions
mavasani Jul 26, 2023
d8c2744
Merge pull request #6805 from mavasani/CA1508_Rethrow
mavasani Jul 26, 2023
2a3d581
Add UseStringMethodCharOverloadWithSingleCharacters analyzer and fixe…
mrahhal Jul 26, 2023
b4ca46d
Merge pull request #6738 from dotnet/locfiles/2c13960e-cc6e-48e0-ae1d…
github-actions[bot] Jul 26, 2023
78ee2b4
Add conservative reset of analysis data in presence of escaped lambda…
mavasani Jul 27, 2023
452e612
Merge pull request #6811 from mavasani/CA1508_Lambda_False_Positive
mavasani Jul 27, 2023
55df92b
Merge pull request #6807 from mavasani/MoveToNewerSourceBuildReferenc…
mavasani Jul 27, 2023
3ccabcd
Add CA1868: Unnecessary call to `Set.Contains(item)` (#6767)
mpidash Jul 28, 2023
a7a004c
Merge branch 'master' into issue_336
CollinAlpert Jul 28, 2023
2005d97
Merge pull request #6793 from mpidash/remove-guarded-set-calls
mavasani Jul 31, 2023
3dd7180
Merge branch 'master' into issue_6652
CollinAlpert Jul 31, 2023
b70dd72
Merge branch 'master' into issue_336
CollinAlpert Jul 31, 2023
17faf1b
Merge pull request #6790 from sharwell/inline-array
sharwell Jul 31, 2023
1bb07ce
Unify HasAttribute and HasAnyAttribute
sharwell Jul 31, 2023
d408d6e
Merge pull request #6821 from sharwell/has-attribute
sharwell Jul 31, 2023
6c11612
PR comments
CollinAlpert Aug 1, 2023
3d7afc8
Merge branch 'master' into issue_6819
CollinAlpert Aug 1, 2023
f730fd3
Merge pull request #6822 from CollinAlpert/issue_6819
mavasani Aug 1, 2023
2c6ef1f
Merge pull request #6826 from CollinAlpert/issue_6824
mavasani Aug 1, 2023
7bb710c
Declare members of generated resources as public
sharwell Aug 1, 2023
240b6a3
Add 'Public' metadata and tests for ResxSourceGenerator
sharwell Aug 1, 2023
c04bbe9
Generate public resource classes when configured
sharwell Aug 1, 2023
64a1e45
Perform exceptions path analysis for all flow analyses
mavasani Aug 2, 2023
ccfaa8e
Remove another assert that is no longer valid
mavasani Aug 2, 2023
032ca22
Merge pull request #6827 from sharwell/public-resx
sharwell Aug 2, 2023
3696f1c
Merge pull request #6828 from mavasani/TryCatchFinallyFlowAnalysisIssue
mavasani Aug 2, 2023
c5108db
Remove CA1508 pragma suppressions
mavasani Aug 3, 2023
e8f78f5
Merge pull request #6832 from mavasani/CA1508_Suppressions
mavasani Aug 3, 2023
319a8f7
Skip exceptions path analysis post pass for global flow analysis
mavasani Aug 4, 2023
870aa7f
Merge pull request #6834 from mavasani/FixRegressions
mavasani Aug 4, 2023
684c4f4
Avoid enumeration overhead by using ImmutableArray<T> instead of Immu…
sharwell Aug 4, 2023
1acc963
Avoid intermediate ImmutableHashSet<T>
sharwell Aug 4, 2023
cf6a95c
Merge pull request #6837 from sharwell/faster-enumeration
sharwell Aug 7, 2023
094e002
Merge branch 'master' into issue_336
CollinAlpert Aug 8, 2023
d6e8aa5
Add analyzer for flagging single-use of local JsonSerializerOptions (…
jozkee Aug 14, 2023
3cdc45f
Add README file to Microsoft.CodeAnalysis.Analyzers NuGet package
mavasani Aug 17, 2023
b357da6
Don´t emit CA1849 when using DbSet.Add and DbSet.AddRange EntityFrame…
Spacefish Aug 17, 2023
b2a8320
Merge pull request #6859 from mavasani/AddReadme
mavasani Aug 18, 2023
7a9b9e5
[Performance] Use Length property instead of Count()
Youssef1313 Aug 19, 2023
909881e
Remove unused using
Youssef1313 Aug 20, 2023
3d7e792
Refactor PropertiesShouldNotBeWriteOnlyAnalyzer (CA1044)
Youssef1313 Aug 20, 2023
3e6eb95
Write CA1824 as non-compilation-end
Youssef1313 Aug 20, 2023
084cf3e
Add minimal binary pattern support for null checks in DFA
Youssef1313 Aug 20, 2023
fb7a687
Update AnalyzerBannedSymbols.txt
jaredpar Aug 21, 2023
1fb799a
Merge pull request #6882 from dotnet/dev/jaredpar/ban-random
jaredpar Aug 21, 2023
d29bfc8
Merge branch 'master' into issue_336
CollinAlpert Aug 22, 2023
76bdbb9
Merge pull request #6872 from Youssef1313/CA1826-refactor
mavasani Aug 28, 2023
8883349
Merge pull request #6864 from Youssef1313/avoid-uninstantiated-perf
mavasani Aug 28, 2023
5a3bc16
Merge pull request #6871 from Youssef1313/make-write-only
mavasani Aug 28, 2023
86df99d
Merge pull request #6874 from Youssef1313/direct-cast
mavasani Aug 28, 2023
2c38096
Merge pull request #6869 from Youssef1313/length-instead-of-count
mavasani Aug 28, 2023
2e6f4e4
Merge pull request #6877 from Youssef1313/dfa-binary-pattern
mavasani Aug 29, 2023
07b9936
Update AnalyzerBannedSymbols.txt
jaredpar Sep 7, 2023
ea021ba
Merge pull request #6917 from dotnet/dev/jaredpar/process
jaredpar Sep 7, 2023
2e4963f
Update AnalyzerBannedSymbols.txt
jaredpar Sep 7, 2023
e1f28df
Add analyzer/fixer to suggest using cached SearchValues instances (#6…
MihaZupan Sep 8, 2023
02a078c
[Performance] Improve UseValidPlatformString (CA1418) performance (#6…
Youssef1313 Sep 12, 2023
6c81243
Merge pull request #6933 from JustArchi/patch-1
mavasani Sep 14, 2023
4bd50d8
Avoid 'Collection was modified' InvalidOperationException
mavasani Sep 14, 2023
2a0d6de
Merge pull request #6935 from mavasani/Issue6929
mavasani Sep 14, 2023
5ddb691
Merge pull request #6940 from mavasani/UpdateAnalyzerReleases
mavasani Sep 15, 2023
6bd2371
Add CA1514: Remove redundant length argument (#6814)
mpidash Sep 22, 2023
7374a16
Merge branch 'master' into issue_6652
CollinAlpert Sep 25, 2023
aed9b4d
Merge branch 'master' into issue_336
CollinAlpert Sep 25, 2023
8c5e468
Source types from GetDeclaredSymbol extension methods
CollinAlpert Sep 25, 2023
6058a76
Add MakeTypesInternalAnalyzer (#6820)
CollinAlpert Sep 25, 2023
2df0735
Merge pull request #6920 from dotnet/dev/jaredpar/console
jaredpar Sep 26, 2023
5d072ac
Use ExportCodeFixProviderAttribute to trigger RS1016
reduckted Sep 29, 2023
84fc4ae
Analyzer for misusage of MaxResponseHeadersLength (#6796)
amiru3f Oct 2, 2023
2b97970
Move type names from FixerWithFixAllAnalyzer to WellKnownTypeNames.
reduckted Oct 3, 2023
d0af10e
Merge pull request #6970 from sharwell/prepare-resources
sharwell Oct 3, 2023
0dc3be1
Add support for ExperimentalAttribute
sharwell Oct 3, 2023
8f94146
Merge pull request #6968 from mpidash/ca1846-fix-typo
mavasani Oct 4, 2023
d1acef9
Merge pull request #6971 from sharwell/experimental-api
sharwell Oct 5, 2023
b88aac3
Merge pull request #6873 from Youssef1313/Ca1824-no-comp-end
mavasani Oct 11, 2023
f23ba4b
Merge branch 'master' into issue_6652
CollinAlpert Oct 15, 2023
f7fcf37
Merge pull request #6683 from CollinAlpert/issue_6652
mavasani Oct 16, 2023
3a58695
Merge branch 'master' into issue_336
CollinAlpert Oct 16, 2023
05ede45
Apply PR comments.
CollinAlpert Oct 16, 2023
b857a22
Add newline
CollinAlpert Oct 17, 2023
c09a1f5
Adjust source generator verifier for broader usability
Youssef1313 Oct 20, 2023
bdd30d7
Update one more
Youssef1313 Oct 20, 2023
bb22e70
Remove unused using
Youssef1313 Oct 20, 2023
bb1a05d
Merge pull request #6995 from Youssef1313/patch-19
sharwell Oct 20, 2023
c584db8
Remove special case MicrosoftCodeAnalysisVersionForBannedApiAnalyzers…
sharwell Oct 20, 2023
ec0e51f
Remove special case MicrosoftCodeAnalysisVersionForPerfSensitiveAnaly…
sharwell Oct 20, 2023
b3bce70
Merge pull request #6996 from sharwell/update-version
sharwell Oct 23, 2023
5011b19
Merge branch 'master' into issue_336
CollinAlpert Oct 25, 2023
9295392
Apply PR comments
CollinAlpert Oct 25, 2023
84bc88b
Fix analyzer description.
CollinAlpert Oct 25, 2023
af9d235
Merge pull request #6980 from mpidash/update-test-sdk
mavasani Oct 30, 2023
45e7d97
Merge pull request #6989 from akoeplinger/patch-1
mavasani Oct 30, 2023
3a83388
Merge pull request #6779 from CollinAlpert/issue_336
mavasani Oct 30, 2023
c03a5b3
Merge branch 'master' into issue_6963
CollinAlpert Oct 30, 2023
0b1d03c
Merge pull request #6986 from CollinAlpert/issue_6963
mavasani Oct 30, 2023
bd9388f
Merge pull request #7013 from CollinAlpert/issue-6981
mavasani Oct 31, 2023
ee5d3ba
[main] Update dependencies from dotnet/arcade (#6972)
dotnet-maestro[bot] Oct 31, 2023
f413540
Merge branch 'main' into bug/CA1307-overload-accessibility
david-acker Nov 1, 2023
f186b43
CA2213:Disposable fields should be disposed and support for `DisposeC…
MartyIX Nov 8, 2023
2f6365d
Support banning base types
aelij Nov 22, 2023
9081eef
Fix Microsoft.CodeAnalysis.Analyzers
aelij Nov 22, 2023
3e68cc3
Don't emit CA1849 for IDbContextFactory.CreateDbContext
CollinAlpert Nov 26, 2023
ad321b4
Merge pull request #7058 from CollinAlpert/issue-7036
mavasani Nov 27, 2023
e36dbe7
Merge pull request #7052 from aelij/feature/banned-base-types
mavasani Nov 29, 2023
9746d9d
Merge pull request #7024 from manfred-brands/Issue7023_CA2241_IFormat…
mavasani Nov 29, 2023
a1efa74
Merge pull request #7017 from dotnet/darc-main-19d6c216-f005-4ab4-9d2…
mavasani Nov 29, 2023
cd8068a
Merge pull request #7014 from CollinAlpert/issue-6983
mavasani Nov 29, 2023
83c4579
Don't raise RS1039 when passing LocalFunctionStatementSyntax
CollinAlpert Nov 30, 2023
902e809
Merge pull request #7044 from CollinAlpert/issue-7033
mavasani Nov 30, 2023
984dbed
Merge pull request #7062 from CollinAlpert/issue-7061
mavasani Nov 30, 2023
70b0dfe
Merge pull request #6998 from david-acker/bug/CA1307-overload-accessi…
mavasani Dec 1, 2023
67ee4f5
Merge pull request #7039 from gewarren/option
mavasani Dec 4, 2023
f810144
Localized file check-in by OneLocBuild Task: Build definition ID 830:…
dotnet-bot Dec 9, 2023
d9e9dca
Merge pull request #7081 from dotnet/locfiles/ad2c9503-5f37-4ecc-9a26…
github-actions[bot] Dec 9, 2023
5ad5c56
Merge pull request #7083 from CollinAlpert/issue-7053
mavasani Dec 11, 2023
4ee5c1d
Merge pull request #7089 from dotnet/locfiles/23fea615-4b2c-4943-8c39…
github-actions[bot] Dec 11, 2023
a8dabb2
Merge pull request #7077 from CollinAlpert/suppress-ca1725-for-generics
mavasani Dec 11, 2023
53b0f6c
Localized file check-in by OneLocBuild Task: Build definition ID 830:…
dotnet-bot Dec 13, 2023
6675a8c
Merge pull request #7094 from dotnet/locfiles/67630858-e20c-4cff-9877…
github-actions[bot] Dec 13, 2023
aa7f080
Implement RS1041 (Compiler extensions should be implemented in assemb…
sharwell Dec 22, 2023
9d777bf
Avoid using SyntaxReference.GetSyntaxAsync
sharwell Dec 28, 2023
feb9298
Provide WellKnownTypeProvider through CodeMetricsAnalysisContext
sharwell Dec 28, 2023
119e162
Avoid captures in AddCoupledNamedTypesCore
sharwell Dec 28, 2023
6d7985c
Avoid string split allocations in GetLinesOfCode
sharwell Dec 28, 2023
356743f
Avoid delegate allocations in GetSemanticModel
sharwell Dec 28, 2023
435f266
Avoid enumerator allocations calling AddCoupledNamedTypes
sharwell Dec 28, 2023
9bb0772
Avoid parallel code metrics calculations within a single member
sharwell Dec 28, 2023
eb4d27f
Cancel code metrics calculation when requested
sharwell Dec 28, 2023
ad02e99
Remove non-standard helper NormalizeLineEndings
sharwell Dec 29, 2023
815b6e0
Merge pull request #6966 from reduckted/feature/5818
mavasani Jan 2, 2024
516e8e9
Merge pull request #7118 from sharwell/metrics-perf
sharwell Jan 2, 2024
4db4205
Merge pull request #7123 from CollinAlpert/issue-7063
mavasani Jan 9, 2024
1bc5455
Merge pull request #7116 from sharwell/check-target-framework
sharwell Jan 9, 2024
ca294cb
Support RefKind.RefReadOnlyParameter in RS0042 (Do not copy value)
sharwell Jan 10, 2024
d99a08a
Merge pull request #7132 from sharwell/ref-readonly
sharwell Jan 11, 2024
c3b07c7
Make AnalyzerOptionsExtensions to have public modifier instead of int…
eriawan Dec 9, 2023
d60d9ea
Set some classes modifiers to public
eriawan Dec 13, 2023
20954ba
Suppress CA1034 on NameParts class
eriawan Dec 13, 2023
eb68c10
update PublicAPI.Unshipped.txt
eriawan Jan 3, 2024
312960c
Add MSBUILD compile constants (preprocess symbol) in Test.Uitilities.…
eriawan Jan 13, 2024
a8352a6
Merge pull request #7085 from eriawan/make-AnalyzerOptionsExtensions-…
mavasani Jan 16, 2024
c082d26
Localized file check-in by OneLocBuild Task: Build definition ID 830:…
dotnet-bot Jan 16, 2024
a7c28a7
Merge pull request #7144 from dotnet/locfiles/6b336955-5e00-40c0-aa59…
github-actions[bot] Jan 16, 2024
89dbeef
Merge pull request #7096 from dotnet/darc-main-bdd038b8-0310-49cc-9da…
mavasani Jan 16, 2024
595525e
Merge pull request #7140 from david-acker/bug-CA1065-explicit-interfa…
mavasani Jan 16, 2024
93959c6
Merge pull request #7142 from RenderMichael/main
mavasani Jan 16, 2024
7648e6b
Merge pull request #7133 from geeknoid/main
mavasani Jan 17, 2024
da7038e
[main] Update dependencies from dotnet/arcade (#7149)
dotnet-maestro[bot] Jan 22, 2024
a85ff92
Add new compiler codebase analyzer for primary constructor capturing …
333fred Jan 25, 2024
395a15d
Adjust message for banned symbol CultureInfo.CurrentCulture (#7167)
RikkiGibson Jan 31, 2024
c108f99
Fix grammar for CA2262's description (#7169)
gewarren Feb 1, 2024
b7bfdb8
Unified Build control update (#7184)
mmitche Feb 9, 2024
7b96e66
Add IsFileLocal lightup, use it in `CA1708`
RenderMichael Feb 12, 2024
e70e55c
Fix nullability
RenderMichael Feb 13, 2024
07e9969
Use the style of other lightup types
RenderMichael Feb 13, 2024
15503b9
PR feedback
RenderMichael Feb 14, 2024
d7605ff
PR feedback
RenderMichael Feb 14, 2024
ffb74ea
Cleanup
RenderMichael Feb 14, 2024
383d1e0
Further PR feedback
RenderMichael Feb 14, 2024
97c1461
CA2263: Prefer generic overload when type is known (#6857)
mpidash Feb 16, 2024
0bdf653
Report RS1008 for ISymbol and IOperation fields
mpidash Feb 17, 2024
a938882
Merge branch 'dotnet:main' into issue-7196
mpidash Feb 17, 2024
10c5ca2
Merge branch 'dotnet:main' into main
RenderMichael Feb 17, 2024
7a691ed
Merge pull request #7190 from RenderMichael/main
sharwell Feb 17, 2024
8e678fc
Add DoNotPassStructToArgumentNullExceptionThrowIfNullAnalyzer (#6815)
CollinAlpert Feb 23, 2024
ea96771
CA1065: Ignore System.Diagnostics.UnreachableException (#7200)
mpidash Feb 27, 2024
efdc653
Support collection expressions for non-copyable analyzer (#7210)
333fred Feb 28, 2024
14b5cc6
Merge pull request #7213 from CollinAlpert/issue-7207
mavasani Mar 1, 2024
8442195
Remove temporary .NET 8 reference assemblies
mpidash Mar 1, 2024
cfd5e5e
Create DoNotCompareSpanToNullAnalyzer (#6838)
CollinAlpert Mar 5, 2024
ee7dd75
Merge pull request #7197 from mpidash/issue-7196
mavasani Mar 5, 2024
2c13845
Merge pull request #7220 from mpidash/issue-6923
mavasani Mar 5, 2024
7703f93
Merge pull request #7211 from ViktorHofer/patch-1
mavasani Mar 5, 2024
9223a71
Add ClassName property to ResxSourceGenerator
raulsntos Mar 6, 2024
5f43b7c
Add UseVolatileReadWriteAnalyzer (#7043)
CollinAlpert Mar 12, 2024
1d052a7
Localized file check-in by OneLocBuild Task: Build definition ID 830:…
dotnet-bot Mar 16, 2024
18e11a0
Merge pull request #7248 from dotnet/locfiles/406d3ea0-8e3b-4d48-8170…
github-actions[bot] Mar 16, 2024
84a4505
Add CA1872: Prefer 'Convert.ToHexString' over 'BitConverter.ToString'…
mpidash Mar 19, 2024
53045f9
Improve support for RefKind.RefReadOnlyParameter in RS0042 (Do not co…
sharwell Mar 20, 2024
daa669a
Merge pull request #7254 from sharwell/ref-readonly
sharwell Mar 20, 2024
ed44eae
Merge pull request #7240 from dotnet/darc-main-2b0ed66f-1abe-414c-bdb…
arunchndr Mar 20, 2024
0b421e3
Add CA2022: Avoid inexact read with 'Stream.Read' (#7208)
mpidash Mar 26, 2024
3f84581
Merge pull request #7255 from richlander/update-eol-vers
sharwell Apr 2, 2024
5b942ec
Add CollectionExpression support to CA1870 (UseSearchValues) (#7252)
MihaZupan Apr 3, 2024
f99864f
Check for the CollectionExpression syntax kind early in UseSearchValu…
MihaZupan Apr 9, 2024
4ddfab2
Avoid direct descriptor comparison, so the fix can be shown
DoctorKrolic Apr 17, 2024
3116c8f
Fix some typos
raulsntos Apr 18, 2024
ef631ec
Merge pull request #7298 from raulsntos/typos
Evangelink Apr 25, 2024
5cf00d9
Feedback and some refactorings
DoctorKrolic Apr 29, 2024
74de427
Merge pull request #7296 from DoctorKrolic/fix-rs1024-codefix
sharwell Apr 29, 2024
d16fa0f
Prevent SemaphoreSlim.Wait(0) from triggering CA1849
CollinAlpert May 10, 2024
3d1c94d
Merge pull request #7226 from raulsntos/resx-generator-class-name
sharwell May 22, 2024
31d7a62
Merge pull request #7316 from dotnet/arkalyanms-rel-build
arunchndr May 28, 2024
cb2b71a
Merge pull request #7301 from dotnet/darc-main-77483941-4b86-4eab-aa4…
Evangelink Jun 3, 2024
c05a345
Merge pull request #7310 from CollinAlpert/issue-7271
sharwell Jun 4, 2024
7903cba
Update to Microsoft.CodeAnalysis.Testing 1.1.2-beta1.24314.1
sharwell Jun 18, 2024
fb474db
Merge pull request #7333 from sharwell/update-testing
sharwell Jun 18, 2024
a542f85
Highlight C# code in unit tests
JakeYallop Jun 25, 2024
028b6e3
Fix
MartyIX Jul 7, 2024
c716d95
Add additional StringSyntax attributes
JakeYallop Jul 24, 2024
089e936
Merge pull request #7335 from JakeYallop/add-string-syntax-attribute
Evangelink Aug 2, 2024
dd9b6a2
Merge pull request #7347 from MartyIX/feature/2024-07-07-CA2213-override
Evangelink Aug 6, 2024
da8a874
Temporarily disable pragma SYSLIB0014 from CSharp CodeFix Verifiers (…
carlossanlop Aug 21, 2024
a759f1c
fix(CA2023: Adds validation against invalid braces in logger message …
Kritner Aug 23, 2024
9774689
CA1854: Use unused variable name for out parameter (#7261)
mpidash Aug 26, 2024
e440100
ExcludeFromSourceBuild->ExcludeFromSourceOnlyBuild (#7414)
mmitche Sep 17, 2024
b7bc899
Add an analyzer for Debug.Assert (#7416)
333fred Sep 26, 2024
f029176
Add new analyzer for deprecating implementing an interface (#7419)
333fred Sep 27, 2024
1f17a7c
Update field references (#7430)
cston Oct 3, 2024
3930be8
Bump analyzers version (#7431)
333fred Oct 7, 2024
667e606
Add CA2024: Do not use 'StreamReader.EndOfStream' in async methods (#…
mpidash Nov 9, 2024
7e5d287
Add NoWarns flag
dvoituron Nov 28, 2024
d1120c0
Add Unit Tests
dvoituron Nov 28, 2024
8e97f9e
Rename NoWarns to NoWarn
dvoituron Nov 28, 2024
657ff42
Merge pull request #7489 from dvoituron/users/dvoituron/resxsourcegen…
sharwell Dec 3, 2024
da84f55
Error when users use a `file` type for things we need to load (#7501)
333fred Dec 16, 2024
44c3b3c
Ensure that PlatformCompatibilityAnalyzer better handles various TFMs…
tannergooding Jan 22, 2025
bc1c5ec
Add CA1873: Avoid potentially expensive logging (#7290)
mpidash Jan 31, 2025
9292ef7
Move Roslyn owned analyzers to their own folder
JoeRobich Feb 7, 2025
facbf82
Merge roslyn-analyzers into the roslyn repo.
JoeRobich Mar 14, 2025
24fbf05
Add roslyn-analyzer projects to solution
JoeRobich Feb 8, 2025
b2ac664
Port of https://github.com/dotnet/roslyn-analyzers/pull/7560
JoeRobich Mar 12, 2025
e56be3a
Fix file headers
JoeRobich Feb 26, 2025
4cf3717
Format whitespace and fix up diagnostics
JoeRobich Feb 26, 2025
8e19642
Fix up tests
JoeRobich Mar 11, 2025
750297d
Update PublishData.json
JoeRobich Mar 11, 2025
0062bfc
Workaround resx issue in Determinism CI
JoeRobich Mar 11, 2025
888aa20
Fix Build_Artifact CI issues
JoeRobich Mar 11, 2025
eedb511
Update source build baseline for roslynanalyzers
JoeRobich Mar 13, 2025
46716e8
Update M.CA.AnalyzerUtilities PublicAPI
JoeRobich Mar 15, 2025
6283f74
Add RoslynAnalyzers folder to CodeOwners
JoeRobich Mar 16, 2025
e230135
Downgrade source build reference packages
JoeRobich Mar 16, 2025
0fd43ee
Fix up sourcebuild errors
JoeRobich Mar 17, 2025
024d07e
Fix up CodeOwners
JoeRobich Mar 17, 2025
214a9db
Merge branch 'main' into dev/jorobich/move-roslyn-analyzers
JoeRobich Mar 17, 2025
a62655b
Update SouceBuild baseline with older Roslyn version.
JoeRobich Mar 17, 2025
eea186a
Merge branch 'main' into dev/jorobich/move-roslyn-analyzers
JoeRobich Mar 28, 2025
a273b2e
Fix up urls in docs
JoeRobich Mar 29, 2025
addb34d
Add rules docs
JoeRobich Mar 29, 2025
ac190a0
Regenerate documentation
JoeRobich Mar 29, 2025
e96d885
Silence warning about release note header
JoeRobich Mar 29, 2025
2d6d7c9
Update default .NET Core metadata references
JoeRobich Mar 29, 2025
a71446b
Use NoWarn for RS2007
JoeRobich Mar 31, 2025
207eb10
Skip tests
JoeRobich Mar 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ dotnet_diagnostic.IDE0055.severity = warning
# https://github.com/dotnet/roslyn-analyzers/issues/7436 - False positives from valid GetDeclaredSymbol calls
dotnet_diagnostic.RS1039.severity = none

# These xUnit analyzers were disabled temporarily to let us move to the
# These xUnit analyzers were disabled temporarily to let us move to the
# new xUnit and get past several component governance issues. The
# following issue tracks enabling them
#
Expand Down
8 changes: 7 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Automatically request reviews when a pull request changes any owned files
# More information: https://github.com/blog/2392-introducing-code-owners

# More information: https://github.com/blog/2392-introducing-code-owners

*.yml @dotnet/roslyn-infrastructure
.github/ @dotnet/roslyn-infrastructure
Expand All @@ -15,15 +16,20 @@ scripts/ @dotnet/roslyn-infrastructure
src/Analyzers/ @dotnet/roslyn-ide
src/CodeStyle/ @dotnet/roslyn-ide
src/Compilers/ @dotnet/roslyn-compiler

# Both IDE and Compiler traits are in this file, so we don't want to ping each other for changes to just this file.

# Technically this means that if someone changes _just_ this file no reviewers will be tagged, but this isn't likely

# to happen.

src/Compilers/Test/Core/Traits/Traits.cs
src/EditorFeatures/ @dotnet/roslyn-ide
src/Features/ @dotnet/roslyn-ide
src/Interactive/ @dotnet/roslyn-interactive
src/LanguageServer/ @dotnet/roslyn-ide
src/NuGet/ @dotnet/roslyn-infrastructure
src/RoslynAnalyzers/ @dotnet/roslyn-ide
src/Scripting/ @dotnet/roslyn-interactive
src/Setup/ @dotnet/roslyn-infrastructure
src/Tools/AnalyzerRunner @dotnet/roslyn-ide
Expand Down
461 changes: 461 additions & 0 deletions Roslyn.sln

Large diffs are not rendered by default.

138 changes: 69 additions & 69 deletions docs/analyzers/FixAllProvider.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions docs/roslyn-analyzers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Roslyn Analyzers

## Microsoft.CodeAnalysis.Analyzers

*Latest stable version:* <sub>[![NuGet](https://img.shields.io/nuget/v/Microsoft.CodeAnalysis.Analyzers.svg)](https://www.nuget.org/packages/Microsoft.CodeAnalysis.Analyzers)</sub>

*Latest pre-release version:* [here](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet7/NuGet/Microsoft.CodeAnalysis.Analyzers/versions)

This package contains rules for correct usage of APIs from the [Microsoft.CodeAnalysis](https://www.nuget.org/packages/Microsoft.CodeAnalysis) NuGet package, i.e. .NET Compiler Platform ("Roslyn") APIs. These are primarily aimed towards helping authors of diagnostic analyzers and code fix providers to invoke the Microsoft.CodeAnalysis APIs in a recommended manner. [More info about rules in this package](../../src/RoslynAnalyzers/Microsoft.CodeAnalysis.Analyzers/Microsoft.CodeAnalysis.Analyzers.md)

## Roslyn.Diagnostics.Analyzers

*Latest stable version:* <sub>[![NuGet](https://img.shields.io/nuget/v/Roslyn.Diagnostics.Analyzers.svg)](https://www.nuget.org/packages/Roslyn.Diagnostics.Analyzers)</sub>

*Latest pre-release version:* [here](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet7/NuGet/Roslyn.Diagnostics.Analyzers/versions)

This package contains rules that are very specific to the .NET Compiler Platform ("Roslyn") project, i.e. [dotnet/roslyn](https://github.com/dotnet/roslyn) repo. This analyzer package is *not intended for general consumption* outside the Roslyn repo. [More info about rules in this package](../../src/RoslynAnalyzers/Roslyn.Diagnostics.Analyzers/Roslyn.Diagnostics.Analyzers.md)

## Microsoft.CodeAnalysis.BannedApiAnalyzers

*Latest stable version:* <sub>[![NuGet](https://img.shields.io/nuget/v/Microsoft.CodeAnalysis.BannedApiAnalyzers.svg)](https://www.nuget.org/packages/Microsoft.CodeAnalysis.BannedApiAnalyzers)</sub>

*Latest pre-release version:* [here](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet7/NuGet/Microsoft.CodeAnalysis.BannedApiAnalyzers/versions)

This package contains customizable rules for identifying references to banned APIs. [More info about rules in this package](../../src/RoslynAnalyzers/Microsoft.CodeAnalysis.BannedApiAnalyzers/Microsoft.CodeAnalysis.BannedApiAnalyzers.md)

For instructions on using this analyzer, see [Instructions](../../src/RoslynAnalyzers/Microsoft.CodeAnalysis.BannedApiAnalyzers/BannedApiAnalyzers.Help.md).

## Microsoft.CodeAnalysis.PublicApiAnalyzers

*Latest stable version:* <sub>[![NuGet](https://img.shields.io/nuget/v/Microsoft.CodeAnalysis.PublicApiAnalyzers.svg)](https://www.nuget.org/packages/Microsoft.CodeAnalysis.PublicApiAnalyzers)</sub>

*Latest pre-release version:* [here](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet7/NuGet/Microsoft.CodeAnalysis.PublicApiAnalyzers/versions)

This package contains rules to help library authors monitoring change to their public APIs. [More info about rules in this package](../../src/RoslynAnalyzers/PublicApiAnalyzers/Microsoft.CodeAnalysis.PublicApiAnalyzers.md)

For instructions on using this analyzer, see [Instructions](../../src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md).
22 changes: 22 additions & 0 deletions docs/roslyn-analyzers/rules/RS1022.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## RS1022: Do not use types from Workspaces assembly in an analyzer

Diagnostic analyzer types should not use types from Workspaces assemblies. Workspaces assemblies are only available when the analyzer executes in Visual Studio IDE live analysis, but are not available during command line build. Referencing types from Workspaces assemblies will lead to runtime exception during analyzer execution in command line build.

|Item|Value|
|-|-|
|Category|MicrosoftCodeAnalysisCorrectness|
|Enabled|True|
|Severity|Warning|
|CodeFix|False|
---

> **Warning**
>
> The analysis performed by RS1022 is slow and relies on implementation details of the JIT compiler for correctness.
> Authors of compiler extensions are encouraged to use the stricter (and faster) analyzer RS1038 instead of this rule.
>
> RS1038 is enabled by default. To enable RS1022 instead, the following configuration may be added to **.globalconfig**:
>
> ```ini
> roslyn_correctness.assembly_reference_validation = relaxed
> ```
46 changes: 46 additions & 0 deletions docs/roslyn-analyzers/rules/RS1038.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## RS1038: Compiler extensions should be implemented in assemblies with compiler-provided references

Types which implement compiler extension points should not be declared in assemblies that contain references to assemblies which are not provided by all compilation scenarios. Doing so may cause the feature to behave unpredictably.

|Item|Value|
|-|-|
|Category|MicrosoftCodeAnalysisCorrectness|
|Enabled|True|
|Severity|Warning|
|CodeFix|False|
---

This rule helps ensure compiler extensions (e.g. analyzers and source generators) will load correctly in all compilation
scenarios. Depending on the manner in which the compiler is invoked, some assemblies may not be present during a build,
and attempting to reference them will result in exceptions that prevent the compiler extension from loading. RS1038 is
the most strict and best performing validation for this scenario.

RS1038 is enabled by default unless relaxed validation has been manually enabled in **.globalconfig** as described in
[RS1022](RS1022.md).

### Rules for compiler feature references

* Compiler features supporting C# code should only reference the NuGet packages **Microsoft.CodeAnalysis.Common** and/or **Microsoft.CodeAnalysis.CSharp**
* Compiler features supporting Visual Basic code should only reference **Microsoft.CodeAnalysis.Common** and/or **Microsoft.CodeAnalysis.VisualBasic**
* Compiler features supporting both C# and Visual Basic should only reference **Microsoft.CodeAnalysis.Common**
* Compiler features should not be implemented in assemblies containing a reference to **Microsoft.CodeAnalysis.Workspaces.Common**

> **Note**
>
> This analyzer only checks references to the core Roslyn assemblies. Compiler extensions with other dependencies may
> face restrictions and/or packaging requirements outside the scope of this analyzer.

### Compiler extension points

The following compiler extension points are examined by this analyzer:

* `DiagnosticAnalyzer`
* `DiagnosticSuppressor`
* `ISourceGenerator`
* `IIncrementalGenerator`

### Other extension points

Some extension points provided by Roslyn are IDE extensions (e.g. code fixes and completion providers). These features
may ship in the same package as compiler features, but should be implemented in their own assembly since they require a
reference to non-compiler package **Microsoft.CodeAnalysis.Workspaces.Common**.
25 changes: 25 additions & 0 deletions docs/roslyn-analyzers/rules/RS1041.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## RS1041: Compiler extensions should be implemented in assemblies targeting netstandard2.0

Types which implement compiler extension points should only be declared in assemblies targeting netstandard2.0. More specific target frameworks are only available in a subset of supported compilation scenarios, so targeting them may cause the feature to behave unpredictably.

|Item|Value|
|-|-|
|Category|MicrosoftCodeAnalysisCorrectness|
|Enabled|True|
|Severity|Warning|
|CodeFix|False|
---

This rule helps ensure compiler extensions (e.g. analyzers and source generators) will load correctly in all compilation
scenarios. Depending on the manner in which the compiler is invoked, the compiler may execute under .NET Framework or
.NET, and compiler extensions are expected to work consistently in both cases. By targeting netstandard2.0, compiler
extensions are known to be compatible with both execution environments.

### Compiler extension points

The following compiler extension points are examined by this analyzer:

* `DiagnosticAnalyzer`
* `DiagnosticSuppressor`
* `ISourceGenerator`
* `IIncrementalGenerator`
27 changes: 24 additions & 3 deletions eng/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<MicrosoftWindowsDesktopAppRuntimePackagesVersion>8.0.10</MicrosoftWindowsDesktopAppRuntimePackagesVersion>
<_xunitVersion>2.9.2</_xunitVersion>
<SqliteVersion>2.1.0</SqliteVersion>
<!-- HumanizerVersion is referenced from the Text.Analyzers.Package.csproj -->
<HumanizerVersion>2.14.1</HumanizerVersion>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -116,7 +118,7 @@
<PackageVersion Include="Nerdbank.Streams" Version="2.11.79" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="StreamJsonRpc" Version="2.21.10" />

<!--
VS Debugger
-->
Expand Down Expand Up @@ -225,8 +227,12 @@
<PackageVersion Include="SQLitePCLRaw.bundle_green" Version="$(SqliteVersion)" />
<PackageVersion Include="SQLitePCLRaw.lib.e_sqlite3" Version="$(SqliteVersion)" />
<PackageVersion Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="$(SqliteVersion)" />
<PackageVersion Include="SQLitePCLRaw.lib.e_sqlite3.linux" Version="$(SqliteVersion)" />
<PackageVersion Include="SQLitePCLRaw.lib.e_sqlite3.osx" Version="$(SqliteVersion)" />
<PackageVersion Include="SQLitePCLRaw.lib.e_sqlite3.v110_xp" Version="$(SqliteVersion)" />
<PackageVersion Include="SQLitePCLRaw.provider.e_sqlite3.net45" Version="$(SqliteVersion)" />

<PackageVersion Include="Humanizer.Core" Version="2.14.1" />
<PackageVersion Include="Humanizer.Core" Version="$(HumanizerVersion)" />
<PackageVersion Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
<PackageVersion Include="Microsoft.CodeAnalysis.Elfie" Version="1.0.0" />

Expand All @@ -237,10 +243,15 @@
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.0" />
<PackageVersion Include="BasicUndo" Version="0.9.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Test.Resources.Proprietary" Version="2.0.0-pre-20160714" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Analyzer.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeRefactoring.Testing" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeRefactoring.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.DiaSymReader.Converter" Version="1.1.0-beta2-22302-02" />
<PackageVersion Include="Microsoft.DiaSymReader.Converter.Xml" Version="1.1.0-beta2-22302-02" />
Expand Down Expand Up @@ -314,5 +325,15 @@
the generators we build would load on the command line but not load in IDEs.
-->
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.1.0" />
</ItemGroup>
<!--
The version of Roslyn used in the RoslynAnalyzers varies. These are defaults that
will be overridden in the RoslynAnalyzer project files.
-->
<!--<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.1.0" /> -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.1.0" />
</ItemGroup>
</Project>
13 changes: 11 additions & 2 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

<UsageData>
<IgnorePatterns>
<!-- These are cases where the component chooses, when built in isolation, to
<!-- These are cases where the component chooses, when built in isolation, to
remain dependent on stable versions. These versions may not have source build intermediates associated with them.
They cannot be source build reference packages because they actually provide functionality. In full source build, these versions are
overridden by previous repo outputs or come from previously source-built artifacts. -->
overridden by previous repo outputs or come from previously source-built artifacts. -->
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Analyzers/*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.AnalyzerUtilities/*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.CSharp.CodeStyle/*" />
Expand Down Expand Up @@ -49,6 +49,15 @@
<UsagePattern IdentityGlob="System.Text.Json/9.0*" />
<UsagePattern IdentityGlob="System.Threading.Tasks.Dataflow/9.0*" />
<UsagePattern IdentityGlob="System.Windows.Extensions/9.0*" />

<!-- This is the version of Microsoft.CodeAnalysis used by RoslynAnalyzers for tooling executed
in repo source-build, as well as unit tests. -->
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis*/*3.11.0*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis*/*4.0.1*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis*/*4.1.0*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis*/*4.6.0-1.final*" />
<!-- Dependency of Microsoft.CodeAnalysis.Common 4.6.0-1.final -->
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis.Analyzers/*3.3.4*" />
</IgnorePatterns>
<Usages>
<Usage Id="Microsoft.Build" Version="17.3.4" IsDirectDependency="true" />
Expand Down
5 changes: 5 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<!-- RoslynAnalyzers reference older builds of Roslyn and this is necessary for SourceBuild. -->
<Dependency Name="Microsoft.CodeAnalysis" Version="3.11.0">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>ae1fff344d46976624e68ae17164e0607ab68b10</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="9.0.0-alpha.1.24575.1">
<Uri>https://github.com/dotnet/source-build-externals</Uri>
Expand Down
Loading