From 54a18196c67008c89093e02eaf0dd536a4f8030f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 4 Oct 2023 22:26:59 +0200 Subject: [PATCH 01/60] Removing duplicated rules from the .editorconfig --- Lombiq.Analyzers/.editorconfig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Lombiq.Analyzers/.editorconfig b/Lombiq.Analyzers/.editorconfig index 1791262b..acac52ef 100644 --- a/Lombiq.Analyzers/.editorconfig +++ b/Lombiq.Analyzers/.editorconfig @@ -23,12 +23,7 @@ trim_trailing_whitespace = true # New line preferences end_of_line = crlf insert_final_newline = true -dotnet_style_operator_placement_when_wrapping = beginning_of_line tab_width = 4 -dotnet_style_coalesce_expression = true:warning -dotnet_style_null_propagation = true:warning -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning -dotnet_style_prefer_auto_properties = true:warning # C# files [*.cs] @@ -64,6 +59,7 @@ dotnet_style_collection_initializer = true:warning dotnet_style_explicit_tuple_names = true:warning dotnet_style_null_propagation = true:warning dotnet_style_object_initializer = true:warning +dotnet_style_operator_placement_when_wrapping = beginning_of_line dotnet_style_prefer_auto_properties = true:warning dotnet_style_prefer_compound_assignment = true:warning dotnet_style_prefer_conditional_expression_over_assignment = true:warning From 93c4a46bafaa5f5fe79183b86a2a3fd342d4440d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 4 Oct 2023 22:31:18 +0200 Subject: [PATCH 02/60] Docs --- Lombiq.Analyzers/Build.props | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Build.props b/Lombiq.Analyzers/Build.props index ea139c5e..a1007c02 100644 --- a/Lombiq.Analyzers/Build.props +++ b/Lombiq.Analyzers/Build.props @@ -78,7 +78,9 @@ + "-target:Restore;LombiqNetAnalyzers" (including the quotes) to restore all package dependencies first. + .editorconfig needs to be copied since this is the only standard way for every editor to be able to use it (until + extending other .editorconfig files will be possible: https://github.com/editorconfig/editorconfig/issues/236).--> Date: Wed, 4 Oct 2023 22:47:16 +0200 Subject: [PATCH 03/60] Code styling --- Lombiq.Analyzers/Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Build.props b/Lombiq.Analyzers/Build.props index a1007c02..066b81a9 100644 --- a/Lombiq.Analyzers/Build.props +++ b/Lombiq.Analyzers/Build.props @@ -80,7 +80,7 @@ project has this target, but that's not really relevant. If you are using NuGet, then the argument should be "-target:Restore;LombiqNetAnalyzers" (including the quotes) to restore all package dependencies first. .editorconfig needs to be copied since this is the only standard way for every editor to be able to use it (until - extending other .editorconfig files will be possible: https://github.com/editorconfig/editorconfig/issues/236).--> + extending other .editorconfig files will be possible: https://github.com/editorconfig/editorconfig/issues/236). --> Date: Wed, 11 Oct 2023 00:36:00 +0200 Subject: [PATCH 04/60] Adding general rules as .globalconfig --- .../Lombiq.Analyzers.General.globalconfig | 426 ++++++++++++++++++ Readme.md | 2 +- 2 files changed, 427 insertions(+), 1 deletion(-) create mode 100644 Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig new file mode 100644 index 00000000..65d027a5 --- /dev/null +++ b/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig @@ -0,0 +1,426 @@ +is_global = true + +# General code analysis rules for any .NET project. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. + +# DotNetAnalyzers.DocumentationAnalyzers +dotnet_diagnostic.DOC100.severity = warning +dotnet_diagnostic.DOC101.severity = warning +dotnet_diagnostic.DOC102.severity = warning +dotnet_diagnostic.DOC103.severity = warning +dotnet_diagnostic.DOC104.severity = warning +dotnet_diagnostic.DOC105.severity = warning +dotnet_diagnostic.DOC106.severity = warning +dotnet_diagnostic.DOC107.severity = warning +dotnet_diagnostic.DOC108.severity = warning +dotnet_diagnostic.DOC200.severity = warning +dotnet_diagnostic.DOC201.severity = warning +dotnet_diagnostic.DOC202.severity = warning +dotnet_diagnostic.DOC203.severity = warning +dotnet_diagnostic.DOC204.severity = warning + +# Microsoft.CodeAnalysis.CSharp rules +dotnet_diagnostic.CS1573.severity = none +dotnet_diagnostic.CS1591.severity = none + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA1000.severity = warning +dotnet_diagnostic.CA1001.severity = warning +dotnet_diagnostic.CA1002.severity = silent +dotnet_diagnostic.CA1008.severity = warning +dotnet_diagnostic.CA1010.severity = warning +dotnet_diagnostic.CA1012.severity = warning +dotnet_diagnostic.CA1016.severity = warning +dotnet_diagnostic.CA1018.severity = warning +dotnet_diagnostic.CA1024.severity = warning +dotnet_diagnostic.CA1027.severity = warning +dotnet_diagnostic.CA1028.severity = warning +dotnet_diagnostic.CA1030.severity = warning +dotnet_diagnostic.CA1031.severity = silent +dotnet_diagnostic.CA1032.severity = warning +dotnet_diagnostic.CA1033.severity = warning +dotnet_diagnostic.CA1034.severity = silent +dotnet_diagnostic.CA1036.severity = warning +dotnet_diagnostic.CA1041.severity = warning +dotnet_diagnostic.CA1043.severity = silent +dotnet_diagnostic.CA1044.severity = warning +dotnet_diagnostic.CA1050.severity = warning +dotnet_diagnostic.CA1051.severity = silent +dotnet_diagnostic.CA1052.severity = warning +dotnet_diagnostic.CA1054.severity = silent +dotnet_diagnostic.CA1055.severity = warning +dotnet_diagnostic.CA1056.severity = silent +dotnet_diagnostic.CA1058.severity = warning +dotnet_diagnostic.CA1061.severity = warning +dotnet_diagnostic.CA1063.severity = warning +dotnet_diagnostic.CA1064.severity = warning +dotnet_diagnostic.CA1065.severity = warning +dotnet_diagnostic.CA1066.severity = warning +dotnet_diagnostic.CA1067.severity = warning +dotnet_diagnostic.CA1068.severity = warning +dotnet_diagnostic.CA1069.severity = warning +dotnet_diagnostic.CA1070.severity = warning +dotnet_diagnostic.CA1200.severity = warning +dotnet_diagnostic.CA1304.severity = warning +dotnet_diagnostic.CA1305.severity = warning +dotnet_diagnostic.CA1307.severity = silent +dotnet_diagnostic.CA1308.severity = warning +dotnet_diagnostic.CA1309.severity = warning +dotnet_diagnostic.CA1310.severity = warning +dotnet_diagnostic.CA1401.severity = warning +dotnet_diagnostic.CA1507.severity = warning +dotnet_diagnostic.CA1508.severity = silent +dotnet_diagnostic.CA1712.severity = warning +dotnet_diagnostic.CA1713.severity = warning +dotnet_diagnostic.CA1715.severity = warning +dotnet_diagnostic.CA1720.severity = warning +dotnet_diagnostic.CA1721.severity = warning +dotnet_diagnostic.CA1801.severity = warning +dotnet_diagnostic.CA1802.severity = warning +dotnet_diagnostic.CA1805.severity = warning +dotnet_diagnostic.CA1806.severity = warning +dotnet_diagnostic.CA1810.severity = warning +dotnet_diagnostic.CA1813.severity = warning +dotnet_diagnostic.CA1814.severity = warning +dotnet_diagnostic.CA1815.severity = warning +dotnet_diagnostic.CA1816.severity = warning +dotnet_diagnostic.CA1820.severity = warning +dotnet_diagnostic.CA1821.severity = warning +dotnet_diagnostic.CA1822.severity = warning +dotnet_diagnostic.CA1823.severity = warning +dotnet_diagnostic.CA1824.severity = warning +dotnet_diagnostic.CA1825.severity = warning +dotnet_diagnostic.CA1826.severity = none +dotnet_diagnostic.CA1827.severity = none +dotnet_diagnostic.CA1828.severity = warning +dotnet_diagnostic.CA1829.severity = warning +dotnet_diagnostic.CA1830.severity = warning +dotnet_diagnostic.CA1832.severity = warning +dotnet_diagnostic.CA1833.severity = warning +dotnet_diagnostic.CA1834.severity = warning +dotnet_diagnostic.CA1835.severity = warning +dotnet_diagnostic.CA1836.severity = warning +dotnet_diagnostic.CA1837.severity = warning +dotnet_diagnostic.CA1838.severity = warning +dotnet_diagnostic.CA1851.severity = warning +dotnet_diagnostic.CA2000.severity = warning +dotnet_diagnostic.CA2002.severity = warning +dotnet_diagnostic.CA2007.severity = warning +dotnet_diagnostic.CA2008.severity = warning +dotnet_diagnostic.CA2009.severity = warning +dotnet_diagnostic.CA2011.severity = warning +dotnet_diagnostic.CA2012.severity = warning +dotnet_diagnostic.CA2016.severity = none +dotnet_diagnostic.CA2100.severity = warning +dotnet_diagnostic.CA2101.severity = warning +dotnet_diagnostic.CA2119.severity = warning +dotnet_diagnostic.CA2153.severity = warning +dotnet_diagnostic.CA2201.severity = warning +dotnet_diagnostic.CA2207.severity = warning +dotnet_diagnostic.CA2208.severity = warning +dotnet_diagnostic.CA2211.severity = warning +dotnet_diagnostic.CA2213.severity = warning +dotnet_diagnostic.CA2214.severity = warning +dotnet_diagnostic.CA2215.severity = warning +dotnet_diagnostic.CA2216.severity = warning +dotnet_diagnostic.CA2217.severity = warning +dotnet_diagnostic.CA2219.severity = warning +dotnet_diagnostic.CA2225.severity = silent +dotnet_diagnostic.CA2226.severity = warning +dotnet_diagnostic.CA2227.severity = warning +dotnet_diagnostic.CA2229.severity = warning +dotnet_diagnostic.CA2231.severity = warning +dotnet_diagnostic.CA2234.severity = silent +dotnet_diagnostic.CA2235.severity = warning +dotnet_diagnostic.CA2237.severity = warning +dotnet_diagnostic.CA2241.severity = warning +dotnet_diagnostic.CA2242.severity = warning +dotnet_diagnostic.CA2243.severity = warning +dotnet_diagnostic.CA2244.severity = warning +dotnet_diagnostic.CA2245.severity = warning +dotnet_diagnostic.CA2246.severity = warning +dotnet_diagnostic.CA2248.severity = warning +dotnet_diagnostic.CA2249.severity = warning +dotnet_diagnostic.CA2300.severity = warning +dotnet_diagnostic.CA2301.severity = warning +dotnet_diagnostic.CA2302.severity = warning +dotnet_diagnostic.CA2305.severity = warning +dotnet_diagnostic.CA2310.severity = warning +dotnet_diagnostic.CA2311.severity = warning +dotnet_diagnostic.CA2312.severity = warning +dotnet_diagnostic.CA2315.severity = warning +dotnet_diagnostic.CA2321.severity = warning +dotnet_diagnostic.CA2322.severity = warning +dotnet_diagnostic.CA2326.severity = warning +dotnet_diagnostic.CA2327.severity = warning +dotnet_diagnostic.CA2328.severity = warning +dotnet_diagnostic.CA2329.severity = warning +dotnet_diagnostic.CA2330.severity = warning +dotnet_diagnostic.CA2350.severity = warning +dotnet_diagnostic.CA2351.severity = warning +dotnet_diagnostic.CA2352.severity = warning +dotnet_diagnostic.CA2353.severity = warning +dotnet_diagnostic.CA2354.severity = warning +dotnet_diagnostic.CA2355.severity = warning +dotnet_diagnostic.CA2356.severity = warning +dotnet_diagnostic.CA2361.severity = warning +dotnet_diagnostic.CA2362.severity = warning +dotnet_diagnostic.CA3001.severity = warning +dotnet_diagnostic.CA3002.severity = warning +dotnet_diagnostic.CA3003.severity = warning +dotnet_diagnostic.CA3004.severity = warning +dotnet_diagnostic.CA3005.severity = warning +dotnet_diagnostic.CA3006.severity = warning +dotnet_diagnostic.CA3007.severity = warning +dotnet_diagnostic.CA3008.severity = warning +dotnet_diagnostic.CA3009.severity = warning +dotnet_diagnostic.CA3010.severity = warning +dotnet_diagnostic.CA3011.severity = warning +dotnet_diagnostic.CA3012.severity = warning +dotnet_diagnostic.CA3061.severity = warning +dotnet_diagnostic.CA3075.severity = warning +dotnet_diagnostic.CA3076.severity = warning +dotnet_diagnostic.CA3077.severity = warning +dotnet_diagnostic.CA3147.severity = warning +dotnet_diagnostic.CA5350.severity = warning +dotnet_diagnostic.CA5351.severity = warning +dotnet_diagnostic.CA5358.severity = warning +dotnet_diagnostic.CA5359.severity = warning +dotnet_diagnostic.CA5360.severity = warning +dotnet_diagnostic.CA5361.severity = warning +dotnet_diagnostic.CA5362.severity = warning +dotnet_diagnostic.CA5363.severity = warning +dotnet_diagnostic.CA5364.severity = warning +dotnet_diagnostic.CA5365.severity = warning +dotnet_diagnostic.CA5366.severity = warning +dotnet_diagnostic.CA5367.severity = warning +dotnet_diagnostic.CA5368.severity = warning +dotnet_diagnostic.CA5369.severity = warning +dotnet_diagnostic.CA5370.severity = warning +dotnet_diagnostic.CA5371.severity = warning +dotnet_diagnostic.CA5372.severity = warning +dotnet_diagnostic.CA5373.severity = warning +dotnet_diagnostic.CA5374.severity = warning +dotnet_diagnostic.CA5375.severity = warning +dotnet_diagnostic.CA5376.severity = warning +dotnet_diagnostic.CA5377.severity = warning +dotnet_diagnostic.CA5378.severity = warning +dotnet_diagnostic.CA5379.severity = warning +dotnet_diagnostic.CA5380.severity = warning +dotnet_diagnostic.CA5381.severity = warning +dotnet_diagnostic.CA5382.severity = warning +dotnet_diagnostic.CA5383.severity = warning +dotnet_diagnostic.CA5384.severity = warning +dotnet_diagnostic.CA5385.severity = warning +dotnet_diagnostic.CA5386.severity = warning +dotnet_diagnostic.CA5387.severity = warning +dotnet_diagnostic.CA5388.severity = warning +dotnet_diagnostic.CA5389.severity = warning +dotnet_diagnostic.CA5390.severity = warning +dotnet_diagnostic.CA5392.severity = warning +dotnet_diagnostic.CA5393.severity = warning +dotnet_diagnostic.CA5394.severity = warning +dotnet_diagnostic.CA5396.severity = warning +dotnet_diagnostic.CA5397.severity = warning +dotnet_diagnostic.CA5398.severity = warning +dotnet_diagnostic.CA5399.severity = warning +dotnet_diagnostic.CA5400.severity = warning +dotnet_diagnostic.CA5401.severity = warning +dotnet_diagnostic.CA5402.severity = warning +dotnet_diagnostic.CA5403.severity = warning + +# Microsoft.VisualStudio.Threading.Analyzers rules +dotnet_diagnostic.VSTHRD002.severity = none +dotnet_diagnostic.VSTHRD102.severity = warning +dotnet_diagnostic.VSTHRD104.severity = warning +dotnet_diagnostic.VSTHRD109.severity = warning +dotnet_diagnostic.VSTHRD111.severity = none +dotnet_diagnostic.VSTHRD112.severity = warning +dotnet_diagnostic.VSTHRD113.severity = warning +dotnet_diagnostic.VSTHRD200.severity = none + +# Meziantou.Analyzer rules +dotnet_diagnostic.MA0001.severity = none +dotnet_diagnostic.MA0002.severity = none +dotnet_diagnostic.MA0003.severity = warning +dotnet_diagnostic.MA0004.severity = none +dotnet_diagnostic.MA0005.severity = none +dotnet_diagnostic.MA0006.severity = none +dotnet_diagnostic.MA0007.severity = none +dotnet_diagnostic.MA0011.severity = none +dotnet_diagnostic.MA0012.severity = none +dotnet_diagnostic.MA0013.severity = none +dotnet_diagnostic.MA0015.severity = none +dotnet_diagnostic.MA0018.severity = none +dotnet_diagnostic.MA0020.severity = none +dotnet_diagnostic.MA0027.severity = none +dotnet_diagnostic.MA0028.severity = none +dotnet_diagnostic.MA0029.severity = none +dotnet_diagnostic.MA0031.severity = none +dotnet_diagnostic.MA0036.severity = none +dotnet_diagnostic.MA0037.severity = none +dotnet_diagnostic.MA0038.severity = none +dotnet_diagnostic.MA0039.severity = none +dotnet_diagnostic.MA0040.severity = warning +dotnet_diagnostic.MA0041.severity = none +dotnet_diagnostic.MA0042.severity = none +dotnet_diagnostic.MA0043.severity = none +dotnet_diagnostic.MA0044.severity = none +dotnet_diagnostic.MA0047.severity = none +dotnet_diagnostic.MA0048.severity = none +dotnet_diagnostic.MA0049.severity = none +dotnet_diagnostic.MA0050.severity = warning +dotnet_diagnostic.MA0051.severity = none +dotnet_diagnostic.MA0052.severity = none +dotnet_diagnostic.MA0053.severity = none +dotnet_diagnostic.MA0056.severity = none +dotnet_diagnostic.MA0057.severity = none +dotnet_diagnostic.MA0058.severity = none +dotnet_diagnostic.MA0059.severity = none +dotnet_diagnostic.MA0062.severity = none +dotnet_diagnostic.MA0063.severity = warning +dotnet_diagnostic.MA0065.severity = none +dotnet_diagnostic.MA0066.severity = none +dotnet_diagnostic.MA0067.severity = warning +dotnet_diagnostic.MA0069.severity = none +dotnet_diagnostic.MA0071.severity = warning +dotnet_diagnostic.MA0072.severity = none +dotnet_diagnostic.MA0073.severity = none +dotnet_diagnostic.MA0074.severity = none +dotnet_diagnostic.MA0075.severity = warning +dotnet_diagnostic.MA0076.severity = warning +dotnet_diagnostic.MA0078.severity = warning +dotnet_diagnostic.MA0079.severity = warning +dotnet_diagnostic.MA0082.severity = none +dotnet_diagnostic.MA0086.severity = none +dotnet_diagnostic.MA0089.severity = warning +dotnet_diagnostic.MA0090.severity = none +dotnet_diagnostic.MA0095.severity = none +dotnet_diagnostic.MA0097.severity = none +dotnet_diagnostic.MA0098.severity = none +dotnet_diagnostic.MA0101.severity = none +dotnet_diagnostic.MA0102.severity = none +dotnet_diagnostic.MA0105.severity = warning +dotnet_diagnostic.MA0106.severity = none +dotnet_diagnostic.MA0111.severity = none +dotnet_diagnostic.MA0120.severity = warning +dotnet_diagnostic.MA0121.severity = warning +dotnet_diagnostic.MA0122.severity = warning + +# SonarAnalyzer.CSharp rules +dotnet_diagnostic.S100.severity = warning +dotnet_diagnostic.S103.severity = warning +dotnet_diagnostic.S104.severity = warning +dotnet_diagnostic.S105.severity = warning +dotnet_diagnostic.S106.severity = warning +dotnet_diagnostic.S107.severity = warning +dotnet_diagnostic.S1075.severity = none +dotnet_diagnostic.S1109.severity = warning +dotnet_diagnostic.S113.severity = warning +dotnet_diagnostic.S1133.severity = none +dotnet_diagnostic.S1144.severity = warning +dotnet_diagnostic.S1145.severity = warning +dotnet_diagnostic.S1147.severity = warning +dotnet_diagnostic.S1151.severity = warning +dotnet_diagnostic.S1192.severity = warning +dotnet_diagnostic.S1226.severity = warning +dotnet_diagnostic.S1227.severity = warning +dotnet_diagnostic.S1244.severity = warning +dotnet_diagnostic.S127.severity = warning +dotnet_diagnostic.S1301.severity = warning +dotnet_diagnostic.S131.severity = warning +dotnet_diagnostic.S134.severity = warning +dotnet_diagnostic.S1696.severity = warning +dotnet_diagnostic.S1698.severity = warning +dotnet_diagnostic.S1858.severity = warning +dotnet_diagnostic.S2148.severity = warning +dotnet_diagnostic.S2197.severity = warning +dotnet_diagnostic.S2278.severity = warning +dotnet_diagnostic.S2302.severity = warning +dotnet_diagnostic.S2330.severity = warning +dotnet_diagnostic.S2333.severity = warning +dotnet_diagnostic.S2342.severity = warning +dotnet_diagnostic.S2357.severity = warning +dotnet_diagnostic.S2387.severity = warning +dotnet_diagnostic.S2437.severity = warning +dotnet_diagnostic.S2699.severity = none +dotnet_diagnostic.S2701.severity = warning +dotnet_diagnostic.S2760.severity = warning +dotnet_diagnostic.S2952.severity = warning +dotnet_diagnostic.S2955.severity = warning +dotnet_diagnostic.S3052.severity = warning +dotnet_diagnostic.S3215.severity = warning +dotnet_diagnostic.S3234.severity = warning +dotnet_diagnostic.S3235.severity = warning +dotnet_diagnostic.S3240.severity = warning +dotnet_diagnostic.S3253.severity = warning +dotnet_diagnostic.S3254.severity = warning +dotnet_diagnostic.S3257.severity = warning +dotnet_diagnostic.S3353.severity = warning +dotnet_diagnostic.S3366.severity = warning +dotnet_diagnostic.S3376.severity = none +dotnet_diagnostic.S3441.severity = warning +dotnet_diagnostic.S3458.severity = none +dotnet_diagnostic.S3532.severity = warning +dotnet_diagnostic.S3626.severity = none +dotnet_diagnostic.S3693.severity = warning +dotnet_diagnostic.S3717.severity = warning +dotnet_diagnostic.S3776.severity = warning +dotnet_diagnostic.S3872.severity = warning +dotnet_diagnostic.S3880.severity = warning +dotnet_diagnostic.S3898.severity = warning +dotnet_diagnostic.S3902.severity = warning +dotnet_diagnostic.S3903.severity = none +dotnet_diagnostic.S3906.severity = warning +dotnet_diagnostic.S3908.severity = warning +dotnet_diagnostic.S3937.severity = warning +dotnet_diagnostic.S3949.severity = warning +dotnet_diagnostic.S3962.severity = warning +dotnet_diagnostic.S3963.severity = none +dotnet_diagnostic.S4002.severity = warning +dotnet_diagnostic.S4025.severity = warning +dotnet_diagnostic.S4041.severity = warning +dotnet_diagnostic.S4047.severity = warning +dotnet_diagnostic.S4052.severity = warning +dotnet_diagnostic.S4212.severity = warning +dotnet_diagnostic.S4225.severity = warning +dotnet_diagnostic.S4226.severity = warning +dotnet_diagnostic.S4261.severity = warning +dotnet_diagnostic.S4432.severity = warning +dotnet_diagnostic.S4487.severity = warning +dotnet_diagnostic.S4564.severity = warning +dotnet_diagnostic.S881.severity = warning + +# StyleCop.Analyzers rules +dotnet_diagnostic.SA0001.severity = none +dotnet_diagnostic.SA1009.severity = none +dotnet_diagnostic.SA1101.severity = none +dotnet_diagnostic.SA1111.severity = none +dotnet_diagnostic.SA1118.severity = none +dotnet_diagnostic.SA1124.severity = none +dotnet_diagnostic.SA1133.severity = none +dotnet_diagnostic.SA1200.severity = none +dotnet_diagnostic.SA1204.severity = none +dotnet_diagnostic.SA1208.severity = none +dotnet_diagnostic.SA1306.severity = none +dotnet_diagnostic.SA1309.severity = none +dotnet_diagnostic.SA1401.severity = none +dotnet_diagnostic.SA1402.severity = none +dotnet_diagnostic.SA1501.severity = none +dotnet_diagnostic.SA1502.severity = none +dotnet_diagnostic.SA1503.severity = none +dotnet_diagnostic.SA1512.severity = none +dotnet_diagnostic.SA1515.severity = none +dotnet_diagnostic.SA1516.severity = none +dotnet_diagnostic.SA1519.severity = none +dotnet_diagnostic.SA1601.severity = none +dotnet_diagnostic.SA1602.severity = none +dotnet_diagnostic.SA1611.severity = none +dotnet_diagnostic.SA1612.severity = none +dotnet_diagnostic.SA1615.severity = none +dotnet_diagnostic.SA1633.severity = none +dotnet_diagnostic.SA1649.severity = none +dotnet_diagnostic.SX1101.severity = warning +dotnet_diagnostic.SX1309S.severity = warning diff --git a/Readme.md b/Readme.md index b38333cd..37fe5c2c 100644 --- a/Readme.md +++ b/Readme.md @@ -64,7 +64,7 @@ When a new version of the .NET SDK comes out then to the following: - Change the `LangVersion` and `AnalysisLevel` elements in the _Build.props_ file to opt in to new language features and analyzers. This does not concern non-SDK-style .NET Framework projects. - Wait for all analyzers to support the new SDK (primarily the new language features). Then update all packages to latest. -- Check if there are new [code analysis categories](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories) that we need to surface warnings for by default in the _.editorconfig_ file. +- Check if there are new [code analysis categories](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories) that we need to surface warnings for by default in the _.globalconfig_ files. ### Adding a new analyzer From e96c1782e034881a461a329fda557288ab7ae33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 01:20:24 +0200 Subject: [PATCH 05/60] Creating .globalconfig files for the rest of the ruleset files --- .../Lombiq.Analyzers.Orchard1.globalconfig | 17 +++++++++++++ .../Lombiq.Analyzers.OrchardCore.globalconfig | 24 +++++++++++++++++++ ...alyzers.VisualStudioExtension.globalconfig | 9 +++++++ 3 files changed, 50 insertions(+) create mode 100644 Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig create mode 100644 Lombiq.Analyzers/Lombiq.Analyzers.OrchardCore.globalconfig create mode 100644 Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig new file mode 100644 index 00000000..85affaa2 --- /dev/null +++ b/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig @@ -0,0 +1,17 @@ +is_global = true + +# General code analysis rules for Orchard 1 projects, extending Lombiq.Analyzers.General.globalconfig + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA1016.severity = none +dotnet_diagnostic.CA3147.severity = none + +# SecurityCodeScan.VS2019 rules +dotnet_diagnostic.SCS0016.severity = none + +# SonarAnalyzer.CSharp rules +dotnet_diagnostic.S3904.severity = none +dotnet_diagnostic.S4564.severity = none diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.OrchardCore.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.OrchardCore.globalconfig new file mode 100644 index 00000000..8b5b151f --- /dev/null +++ b/Lombiq.Analyzers/Lombiq.Analyzers.OrchardCore.globalconfig @@ -0,0 +1,24 @@ +is_global = true + +# General code analysis rules for Orchard Core projects, extending Lombiq.Analyzers.General.globalconfig + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. + + +# Microsoft.CodeAnalysis.CSharp rules +dotnet_diagnostic.CS1591.severity = none + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA1014.severity = none +dotnet_diagnostic.CA1019.severity = silent +dotnet_diagnostic.CA1062.severity = silent +dotnet_diagnostic.CA1710.severity = silent +dotnet_diagnostic.CA1711.severity = silent +dotnet_diagnostic.CA1716.severity = silent +dotnet_diagnostic.CA1724.severity = silent +dotnet_diagnostic.CA1812.severity = silent +dotnet_diagnostic.CA1848.severity = none +dotnet_diagnostic.CA2007.severity = silent +dotnet_diagnostic.CA5391.severity = silent +dotnet_diagnostic.CA5395.severity = silent diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig new file mode 100644 index 00000000..957960c8 --- /dev/null +++ b/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig @@ -0,0 +1,9 @@ +is_global = true + +# General code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.General.globalconfig + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. + +# Microsoft.VisualStudio.Threading.Analyzers rules +dotnet_diagnostic.VSTHRD002.severity = warning From 274038c1c32c96238c2d4d244d3adc08f4519c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 01:38:20 +0200 Subject: [PATCH 06/60] Moving C# rules from .editorconfig to .globalconfig --- Lombiq.Analyzers/.editorconfig | 261 ------------------ .../Lombiq.Analyzers.General.globalconfig | 238 +++++++++++++++- 2 files changed, 236 insertions(+), 263 deletions(-) diff --git a/Lombiq.Analyzers/.editorconfig b/Lombiq.Analyzers/.editorconfig index acac52ef..574b0e97 100644 --- a/Lombiq.Analyzers/.editorconfig +++ b/Lombiq.Analyzers/.editorconfig @@ -1,12 +1,6 @@ # WARNING: Only edit this file in the Lombiq .NET Analyzers repository's "Lombiq.Analyzers" folder. A copy of this file # anywhere else will be overwritten. -# Common .NET conventions, code formatting and naming convention rules. Check out possible configs here: -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference -# If you found some issue then try to fix it, which you can also do from VS Quick Actions: -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#automatically-configure-code-styles -# Add new file types at the bottom. For new rules for C# files follow the structure that VS generates. - # All files [*] @@ -19,266 +13,11 @@ indent_size = 4 indent_style = space trim_trailing_whitespace = true - # New line preferences end_of_line = crlf insert_final_newline = true tab_width = 4 -# C# files -[*.cs] - -#### .NET Coding Conventions #### - -# Organize usings -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = false - -# this. and Me. preferences -dotnet_style_qualification_for_event = false:warning -dotnet_style_qualification_for_field = false:warning -dotnet_style_qualification_for_method = false:warning -dotnet_style_qualification_for_property = false:warning - -# Language keywords vs BCL types preferences -dotnet_style_predefined_type_for_locals_parameters_members = true:warning -dotnet_style_predefined_type_for_member_access = true:warning - -# Parentheses preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent - -# Modifier preferences -dotnet_style_require_accessibility_modifiers = always:warning - -# Expression-level preferences -dotnet_style_coalesce_expression = true:warning -dotnet_style_collection_initializer = true:warning -dotnet_style_explicit_tuple_names = true:warning -dotnet_style_null_propagation = true:warning -dotnet_style_object_initializer = true:warning -dotnet_style_operator_placement_when_wrapping = beginning_of_line -dotnet_style_prefer_auto_properties = true:warning -dotnet_style_prefer_compound_assignment = true:warning -dotnet_style_prefer_conditional_expression_over_assignment = true:warning -dotnet_style_prefer_conditional_expression_over_return = false -dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning -dotnet_style_prefer_inferred_tuple_names = true:warning -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning -dotnet_style_prefer_simplified_interpolation = true:warning - -# Field preferences -dotnet_style_readonly_field = true:warning - -# Parameter preferences -dotnet_code_quality_unused_parameters = non_pubic:suggestion - -#### C# Style Rules #### - -#IDE* rules are managed here. - -# Note that currently both IDE* rules and csharp_style_* rules are necessary, because only IDE rules will be enforced -# during build, see: https://github.com/dotnet/roslyn/issues/44201. - -# Default severity for analyzer diagnostics for all categories (escalated to build warnings). See -# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories for the list of categories. -dotnet_analyzer_diagnostic.category-Design.severity = warning -dotnet_analyzer_diagnostic.category-Documentation.severity = warning -dotnet_analyzer_diagnostic.category-Globalization.severity = warning -dotnet_analyzer_diagnostic.category-Interoperability.severity = warning -dotnet_analyzer_diagnostic.category-Maintainability.severity = warning -dotnet_analyzer_diagnostic.category-Naming.severity = warning -dotnet_analyzer_diagnostic.category-Performance.severity = warning -dotnet_analyzer_diagnostic.category-SingleFile.severity = warning -dotnet_analyzer_diagnostic.category-Reliability.severity = warning -dotnet_analyzer_diagnostic.category-Security.severity = warning -dotnet_analyzer_diagnostic.category-Style.severity = warning -dotnet_analyzer_diagnostic.category-Usage.severity = warning -dotnet_analyzer_diagnostic.category-CodeQuality.severity = warning - -# IDE0011: Add braces to 'if' statement. -# The "when-multiline:warning" config is not actually for cases when the if body is in another line so we have to turn -# this off completely, see: https://github.com/dotnet/roslyn/issues/40912. -dotnet_diagnostic.IDE0011.severity = none -# IDE0050: Convert to tuple -# Quite dangerous as we most frequently use anonymous types to interface with other APIs (like generating routes) and -# those can fail on this silently in runtime while building correctly. -dotnet_diagnostic.IDE0050.severity = none -# IDE0052: Private member can be removed as the value assigned to it is never used. -# We use S4487 for that. -dotnet_diagnostic.IDE0052.severity = none -# IDE0072: Populate switch -# Also signals on switches with discards, by design: https://github.com/dotnet/roslyn/issues/48876. -dotnet_diagnostic.IDE0072.severity = none -# "Namespace 'Foo' does not match folder structure, expected 'Foo'" -dotnet_diagnostic.IDE0130.severity = none - -# While these are in the Style category, they need to be explicitly set for some reason. -# IDE0079 Remove unnecessary suppression -dotnet_diagnostic.IDE0079.severity = warning -dotnet_diagnostic.IDE0022.severity = warning - -# 'var' preferences -dotnet_diagnostic.IDE0007.severity = warning -dotnet_diagnostic.IDE0008.severity = none - -# We don't want to decorate every public member with XML comments, only public APIs - so turn CS1591 off. -# CS1591 Missing XML Comment for publicly visible type or member -dotnet_diagnostic.CS1591.severity = none - -#### C# Coding Conventions #### - -# 'var' preferences -# These won't take effect during build due to this bug: -# https://github.com/dotnet/roslyn/issues/44250 -csharp_style_var_elsewhere = true:warning -# If this is not turned off then there will be messages for e.g. integers too, like in for loops. -csharp_style_var_for_built_in_types = false:none -csharp_style_var_when_type_is_apparent = true:warning - -# Expression-bodied members -csharp_style_expression_bodied_accessors = true:warning -csharp_style_expression_bodied_constructors = true:warning -csharp_style_expression_bodied_indexers = true:warning -csharp_style_expression_bodied_lambdas = true:warning -csharp_style_expression_bodied_local_functions = true:warning -csharp_style_expression_bodied_methods = true:warning -csharp_style_expression_bodied_operators = true:warning -csharp_style_expression_bodied_properties = true:warning - -# Pattern matching preferences -csharp_style_pattern_matching_over_as_with_null_check = true:warning -csharp_style_pattern_matching_over_is_with_cast_check = true:warning -csharp_style_prefer_switch_expression = true:warning - -# Null-checking preferences -csharp_style_conditional_delegate_call = true:warning - -# Modifier preferences -csharp_prefer_static_local_function = true:warning -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent - -# Code-block preferences -csharp_prefer_simple_using_statement = true:warning -# IDE0160: Convert to block-scoped namespace -csharp_style_namespace_declarations = file_scoped:warning - -# Expression-level preferences -csharp_prefer_simple_default_expression = true:warning -csharp_style_deconstructed_variable_declaration = false:silent -csharp_style_inlined_variable_declaration = true:warning -csharp_style_pattern_local_over_anonymous_function = true:warning -csharp_style_prefer_index_operator = true:warning -csharp_style_prefer_range_operator = true:warning -csharp_style_throw_expression = true:warning -csharp_style_unused_value_assignment_preference = discard_variable:suggestion -csharp_style_unused_value_expression_statement_preference = discard_variable:none - -# 'using' directive preferences -csharp_using_directive_placement = outside_namespace:silent - -#### C# Formatting Rules #### - -# New line preferences -csharp_new_line_before_catch = true -csharp_new_line_before_else = true -csharp_new_line_before_finally = true -csharp_new_line_before_members_in_anonymous_types = true -csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_open_brace = all -csharp_new_line_between_query_expression_clauses = true - -# Indentation preferences -csharp_indent_block_contents = true -csharp_indent_braces = false -csharp_indent_case_contents = true -csharp_indent_case_contents_when_block = true -csharp_indent_labels = no_change -csharp_indent_switch_labels = true - -# Space preferences -csharp_space_after_cast = false -csharp_space_after_colon_in_inheritance_clause = true -csharp_space_after_comma = true -csharp_space_after_dot = false -csharp_space_after_keywords_in_control_flow_statements = true -csharp_space_after_semicolon_in_for_statement = true -csharp_space_around_binary_operators = before_and_after -csharp_space_around_declaration_statements = false -csharp_space_before_colon_in_inheritance_clause = true -csharp_space_before_comma = false -csharp_space_before_dot = false -csharp_space_before_open_square_brackets = false -csharp_space_before_semicolon_in_for_statement = false -csharp_space_between_empty_square_brackets = false -csharp_space_between_method_call_empty_parameter_list_parentheses = false -csharp_space_between_method_call_name_and_opening_parenthesis = false -csharp_space_between_method_call_parameter_list_parentheses = false -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -csharp_space_between_method_declaration_name_and_open_parenthesis = false -csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_parentheses = false -csharp_space_between_square_brackets = false - -# Wrapping preferences -csharp_preserve_single_line_blocks = true -csharp_preserve_single_line_statements = true - -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = * -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = * -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = * -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case - -# Disabling "catch a more specific exception type" suggestion which is overwhelmingly a false positive. -dotnet_diagnostic.CA1031.severity = silent -# Disabling "do not nest type" suggestion. -dotnet_diagnostic.CA1034.severity = silent -# Disabling "CA1810: Initialize reference type static fields inline" as RSPEC-3963 is used instead. -dotnet_diagnostic.CA1810.severity = none - -# Don't apply "CA1822: Mark members as static" to the public API -dotnet_code_quality.ca1822.api_surface = private, internal -csharp_prefer_braces = true:silent - # Various config files [*.{config,csproj,json,props,targets}] diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig index 65d027a5..0aeee31c 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig +++ b/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig @@ -5,7 +5,236 @@ is_global = true # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and # rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. -# DotNetAnalyzers.DocumentationAnalyzers +# Start code style preferences + +# Check out possible configs here: +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:warning +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_property = false:warning + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = always:warning + +# Expression-level preferences +dotnet_style_coalesce_expression = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_null_propagation = true:warning +dotnet_style_object_initializer = true:warning +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_compound_assignment = true:warning +dotnet_style_prefer_conditional_expression_over_assignment = true:warning +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:warning +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning +dotnet_style_prefer_simplified_interpolation = true:warning + +# Field preferences +dotnet_style_readonly_field = true:warning + +# Parameter preferences +dotnet_code_quality_unused_parameters = non_pubic:suggestion + +# Note that currently both IDE* rules and csharp_style_* rules are necessary, because only IDE rules will be enforced +# during build, see: https://github.com/dotnet/roslyn/issues/44201. + +# Default severity for analyzer diagnostics for all categories (escalated to build warnings). See +# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories for the list of categories. +dotnet_analyzer_diagnostic.category-Design.severity = warning +dotnet_analyzer_diagnostic.category-Documentation.severity = warning +dotnet_analyzer_diagnostic.category-Globalization.severity = warning +dotnet_analyzer_diagnostic.category-Interoperability.severity = warning +dotnet_analyzer_diagnostic.category-Maintainability.severity = warning +dotnet_analyzer_diagnostic.category-Naming.severity = warning +dotnet_analyzer_diagnostic.category-Performance.severity = warning +dotnet_analyzer_diagnostic.category-SingleFile.severity = warning +dotnet_analyzer_diagnostic.category-Reliability.severity = warning +dotnet_analyzer_diagnostic.category-Security.severity = warning +dotnet_analyzer_diagnostic.category-Style.severity = warning +dotnet_analyzer_diagnostic.category-Usage.severity = warning +dotnet_analyzer_diagnostic.category-CodeQuality.severity = warning + +# IDE0011: Add braces to 'if' statement. +# The "when-multiline:warning" config is not actually for cases when the if body is in another line so we have to turn +# this off completely, see: https://github.com/dotnet/roslyn/issues/40912. +dotnet_diagnostic.IDE0011.severity = none +# IDE0050: Convert to tuple +# Quite dangerous as we most frequently use anonymous types to interface with other APIs (like generating routes) and +# those can fail on this silently in runtime while building correctly. +dotnet_diagnostic.IDE0050.severity = none +# IDE0052: Private member can be removed as the value assigned to it is never used. +# We use S4487 for that. +dotnet_diagnostic.IDE0052.severity = none +# IDE0072: Populate switch +# Also signals on switches with discards, by design: https://github.com/dotnet/roslyn/issues/48876. +dotnet_diagnostic.IDE0072.severity = none +# "Namespace 'Foo' does not match folder structure, expected 'Foo'" +dotnet_diagnostic.IDE0130.severity = none + +# While these are in the Style category, they need to be explicitly set for some reason. +# IDE0079 Remove unnecessary suppression +dotnet_diagnostic.IDE0079.severity = warning +dotnet_diagnostic.IDE0022.severity = warning + +# 'var' preferences +dotnet_diagnostic.IDE0007.severity = warning +dotnet_diagnostic.IDE0008.severity = none +# These won't take effect during build due to this bug: https://github.com/dotnet/roslyn/issues/44250. +csharp_style_var_elsewhere = true:warning +# If this is not turned off then there will be messages for e.g. integers too, like in for loops. +csharp_style_var_for_built_in_types = false:none +csharp_style_var_when_type_is_apparent = true:warning + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:warning +csharp_style_expression_bodied_constructors = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_lambdas = true:warning +csharp_style_expression_bodied_local_functions = true:warning +csharp_style_expression_bodied_methods = true:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:warning +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_prefer_switch_expression = true:warning + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:warning + +# Modifier preferences +csharp_prefer_static_local_function = true:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent + +# Code-block preferences +csharp_prefer_simple_using_statement = true:warning +# IDE0160: Convert to block-scoped namespace +csharp_style_namespace_declarations = file_scoped:warning + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:warning +csharp_style_deconstructed_variable_declaration = false:silent +csharp_style_inlined_variable_declaration = true:warning +csharp_style_pattern_local_over_anonymous_function = true:warning +csharp_style_prefer_index_operator = true:warning +csharp_style_prefer_range_operator = true:warning +csharp_style_throw_expression = true:warning +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:none + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = no_change +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +# Naming rules +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = * +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = * +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = * +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +# Don't apply "CA1822: Mark members as static" to the public API +dotnet_code_quality.CA1822.api_surface = private, internal +csharp_prefer_braces = true:silent + +# End code style preferences + +# DotNetAnalyzers.DocumentationAnalyzers rules dotnet_diagnostic.DOC100.severity = warning dotnet_diagnostic.DOC101.severity = warning dotnet_diagnostic.DOC102.severity = warning @@ -23,6 +252,8 @@ dotnet_diagnostic.DOC204.severity = warning # Microsoft.CodeAnalysis.CSharp rules dotnet_diagnostic.CS1573.severity = none +# We don't want to decorate every public member with XML comments, only public APIs - so turn CS1591 off. +# CS1591 Missing XML Comment for publicly visible type or member dotnet_diagnostic.CS1591.severity = none # Microsoft.CodeAnalysis.NetAnalyzers rules @@ -38,9 +269,11 @@ dotnet_diagnostic.CA1024.severity = warning dotnet_diagnostic.CA1027.severity = warning dotnet_diagnostic.CA1028.severity = warning dotnet_diagnostic.CA1030.severity = warning +# Disabling "catch a more specific exception type" suggestion which is overwhelmingly a false positive. dotnet_diagnostic.CA1031.severity = silent dotnet_diagnostic.CA1032.severity = warning dotnet_diagnostic.CA1033.severity = warning +# Disabling "do not nest type" suggestion. dotnet_diagnostic.CA1034.severity = silent dotnet_diagnostic.CA1036.severity = warning dotnet_diagnostic.CA1041.severity = warning @@ -81,7 +314,8 @@ dotnet_diagnostic.CA1801.severity = warning dotnet_diagnostic.CA1802.severity = warning dotnet_diagnostic.CA1805.severity = warning dotnet_diagnostic.CA1806.severity = warning -dotnet_diagnostic.CA1810.severity = warning +# Disabling "CA1810: Initialize reference type static fields inline" as RSPEC-3963 is used instead. +dotnet_diagnostic.CA1810.severity = none dotnet_diagnostic.CA1813.severity = warning dotnet_diagnostic.CA1814.severity = warning dotnet_diagnostic.CA1815.severity = warning From 5813e19a5e53b175b2d91695869db09687ccc8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 01:56:50 +0200 Subject: [PATCH 07/60] Removing ruleset files and using analyzer configs from .globalconfig files --- Lombiq.Analyzers/Build.props | 6 +- .../Lombiq.Analyzers.General.globalconfig | 1 + .../Lombiq.Analyzers.Orchard1.globalconfig | 1 + .../Lombiq.Analyzers.OrchardCore.globalconfig | 1 + ...alyzers.VisualStudioExtension.globalconfig | 1 + Lombiq.Analyzers/NetFx.Build.props | 7 +- .../VisualStudioExtension.Build.props | 7 +- Lombiq.Analyzers/general.ruleset | 439 ------------------ Lombiq.Analyzers/orchard1.ruleset | 15 - Lombiq.Analyzers/orchardcore.ruleset | 26 -- .../visualstudioextension.ruleset | 7 - 11 files changed, 19 insertions(+), 492 deletions(-) delete mode 100644 Lombiq.Analyzers/general.ruleset delete mode 100644 Lombiq.Analyzers/orchard1.ruleset delete mode 100644 Lombiq.Analyzers/orchardcore.ruleset delete mode 100644 Lombiq.Analyzers/visualstudioextension.ruleset diff --git a/Lombiq.Analyzers/Build.props b/Lombiq.Analyzers/Build.props index 066b81a9..14fa72cd 100644 --- a/Lombiq.Analyzers/Build.props +++ b/Lombiq.Analyzers/Build.props @@ -1,6 +1,5 @@ - $(MSBuildThisFileDirectory)orchardcore.ruleset true $(OutputPath) @@ -28,6 +27,12 @@ <_SkipUpgradeNetAnalyzersNuGetWarning>true + + + + + + diff --git a/Lombiq.Analyzers/VisualStudioExtension.Build.props b/Lombiq.Analyzers/VisualStudioExtension.Build.props index 58d4ba85..1385c956 100644 --- a/Lombiq.Analyzers/VisualStudioExtension.Build.props +++ b/Lombiq.Analyzers/VisualStudioExtension.Build.props @@ -1,6 +1,7 @@ + + + + - - $(MSBuildThisFileDirectory)visualstudioextension.ruleset - diff --git a/Lombiq.Analyzers/general.ruleset b/Lombiq.Analyzers/general.ruleset deleted file mode 100644 index 5699f6b0..00000000 --- a/Lombiq.Analyzers/general.ruleset +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Lombiq.Analyzers/orchard1.ruleset b/Lombiq.Analyzers/orchard1.ruleset deleted file mode 100644 index 8b2472ee..00000000 --- a/Lombiq.Analyzers/orchard1.ruleset +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/Lombiq.Analyzers/orchardcore.ruleset b/Lombiq.Analyzers/orchardcore.ruleset deleted file mode 100644 index aa7cb16e..00000000 --- a/Lombiq.Analyzers/orchardcore.ruleset +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Lombiq.Analyzers/visualstudioextension.ruleset b/Lombiq.Analyzers/visualstudioextension.ruleset deleted file mode 100644 index 35ccbb0e..00000000 --- a/Lombiq.Analyzers/visualstudioextension.ruleset +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - From 1216e514ccfa589024772aee8ecaa820339441f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 02:10:10 +0200 Subject: [PATCH 08/60] Spelling --- Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig index fa66765d..324f7803 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig +++ b/Lombiq.Analyzers/Lombiq.Analyzers.General.globalconfig @@ -135,7 +135,7 @@ csharp_style_namespace_declarations = file_scoped:warning # Expression-level preferences csharp_prefer_simple_default_expression = true:warning -csharp_style_deconstructed_variable_declaration = false:silent +csharp_style_deconstructed_variable_declaration = false:silent #spell-check-ignore-line csharp_style_inlined_variable_declaration = true:warning csharp_style_pattern_local_over_anonymous_function = true:warning csharp_style_prefer_index_operator = true:warning From a001210c5f0717236db164556424e14bbc3e57e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 02:50:42 +0200 Subject: [PATCH 09/60] Note on centralizing analyzer config in .NET Framework projects --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index 387e99d4..60ca908c 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -71,6 +71,7 @@ You can also add the package to all projects inside a folder at once [from a _Di ``` + If you do this for multiple projects, it's recommended to add your own central props file (like _Analyzers.Build.props_) where you do the above and import that in each project instead. 3. The _NetFx.Build.props_ will copy this project's _.editorconfig_ file into every project folder that you've created a _Directory.Build.props_ in, so you might want to gitignore those: From 755c2325ecfb09e8ab15799a11ad98ce54b563ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 14:57:12 +0200 Subject: [PATCH 10/60] Configuration docs --- Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md | 44 ++++++------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md index a779dc55..0dce982c 100644 --- a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md +++ b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md @@ -21,7 +21,7 @@ This will completely disable code analysis packages. To also disable .NET SDK an dotnet_analyzer_diagnostic.category-Style.severity = none ``` -## How to disable analyzers during `dotnet build` +## How to disable all analyzers during `dotnet build` By default the `dotnet build` command runs analyzers and produces code analysis warnings if there are any but it makes the build slower. Pass the `/p:RunCodeAnalysis=false` parameter to disable analyzers during build, like: @@ -33,36 +33,19 @@ dotnet build MySolution.sln /p:RunCodeAnalysis=false If not all the configuration in this project is suitable for your solution then you can also override them globally. This way, the default configuration will be merged with your custom configuration and you can override any number of rules conveniently at one place for all projects in your solution. -### Overriding analyzer configuration from a ruleset file +### Overriding analyzer configuration from a _.globalconfig_ file -1. Create your own ruleset file, similar to this project's _general.ruleset_ file. Make sure the file name is all lower-case, because if you edit it in Visual Studio it will be converted anyway and that could cause problems on Unix-like systems. Add any rule configurations there that you want to override. Also, include this project's _general.ruleset_ file as a child, allowing its rules to be available by default. In the end you should have something like this (the included rules only serve as an example): +1. Create your own _.globalconfig_ file with your own rule configuration, similar to this project's _general.ruleset_ file (see [the official docs on this file format](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig)). +2. Place the file into the folder under which you want the configuration to apply to all projects. +3. Now every rule you've defined in your _.globalconfig_ file will take precedence over the default ones. For everything else, the default ones will be applied. - ```xml - - - - - - - - - - - ``` +Note that if you add your _.globalconfig_ file to the solution you'll get GUI support for it in Visual Studio and you'll be able to configure rules without manually editing the configuration text. -2. In the _Directory.Build.props_ file of your solution add a reference to your own ruleset file, overriding the default: +More complex configuration is also available: - ```xml - - $(MSBuildThisFileDirectory)my.ruleset - - ``` - -3. Now every rule you've defined in _my.ruleset_ will take precedence over the default ones. For everything else, the default ones will be applied. - -Note that if you add your ruleset file to the solution you'll get GUI support for it in Visual Studio and you'll be able to configure rules without manually editing the XML. - -You can similarly add such `ruleset` files to subfolders, to just override rules for projects in that folder. +- You can similarly add such _.globalconfig_ files to subfolders, to just override rules for projects in that folder. +- Such files can be placed outside of the folder hierarchy too and referenced from csproj or props files with the `` element, see [the docs](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#naming). +- You can further adjust the precedence of _.globalconfig_ files with their names and the `global_level` entry, see [the docs](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#precedence). ### Suppressing analyzers from code for a whole project @@ -87,11 +70,10 @@ using System.Diagnostics.CodeAnalysis; You can't as easily do the same as with ruleset files with _.editorconfig_ rules. [It's not possible to define explicit inheritance between _.editorconfig_ files](https://github.com/editorconfig/editorconfig/issues/236) so [the only option is to use the folder hierarchy](https://stackoverflow.com/questions/58543855/can-visual-studio-use-an-editorconfig-not-in-the-directory-hierarchy/58556556#58556556): The _Build.props_ file of this project copies the default _.editorconfig_ file into the solution root. If you put your projects below that in the folder hierarchy and use your own _.editorconfig_ there then the latter will take precedence and you can override the default rules. E.g. you can override certain analyzer rules for a whole folder (even a folder within a project) like this: ```editor-config -# C# files -[*.cs] +# All files +[*] -# MA0016: Prefer return collection abstraction instead of implementation -dotnet_diagnostic.MA0016.severity = none +guidelines = 150 1px solid a0ffc000, 180 1px solid 80ff0000 ``` While eventually all analyzer rules in the .NET ecosystem will live in _.editorconfig_ this is not the case yet. However, you can override _.editorconfig_ rules from a ruleset file: You can open the ruleset file in Visual Studio and under the `Microsoft.CodeAnalysis.CSharp.Features` section you'll also be able to configure each IDE\* rule. From ff5835a4389c69d0ac325e77e0bf02b100c98ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 14:57:28 +0200 Subject: [PATCH 11/60] Packing .globalconfig files --- Lombiq.Analyzers/Lombiq.Analyzers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.csproj b/Lombiq.Analyzers/Lombiq.Analyzers.csproj index 1335deb9..c1c66e7a 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.csproj +++ b/Lombiq.Analyzers/Lombiq.Analyzers.csproj @@ -21,7 +21,7 @@ - + From 8658092eeb3add94681c5d789c8629f6249539d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 15:29:17 +0200 Subject: [PATCH 12/60] Publishing alpha package --- .../Lombiq.Analyzers.PackageReference.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj index eee58ccf..27f1c1aa 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj @@ -5,7 +5,7 @@ - + all From ed2281fae2e1e0ecb0074b1912097ea48512814e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 15:29:29 +0200 Subject: [PATCH 13/60] Docs --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 37fe5c2c..1b67a9df 100644 --- a/Readme.md +++ b/Readme.md @@ -64,7 +64,7 @@ When a new version of the .NET SDK comes out then to the following: - Change the `LangVersion` and `AnalysisLevel` elements in the _Build.props_ file to opt in to new language features and analyzers. This does not concern non-SDK-style .NET Framework projects. - Wait for all analyzers to support the new SDK (primarily the new language features). Then update all packages to latest. -- Check if there are new [code analysis categories](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories) that we need to surface warnings for by default in the _.globalconfig_ files. +- Check if there are new [code analysis categories](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories) that we need to surface warnings for by default in the main _.globalconfig_ file. ### Adding a new analyzer From d166c5f0638c120f3b69fa21f602cfc22fa37b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 15:35:02 +0200 Subject: [PATCH 14/60] Other editorconfig sample to fix spell-checking error --- Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md index 0dce982c..23eb0ab2 100644 --- a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md +++ b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md @@ -70,10 +70,9 @@ using System.Diagnostics.CodeAnalysis; You can't as easily do the same as with ruleset files with _.editorconfig_ rules. [It's not possible to define explicit inheritance between _.editorconfig_ files](https://github.com/editorconfig/editorconfig/issues/236) so [the only option is to use the folder hierarchy](https://stackoverflow.com/questions/58543855/can-visual-studio-use-an-editorconfig-not-in-the-directory-hierarchy/58556556#58556556): The _Build.props_ file of this project copies the default _.editorconfig_ file into the solution root. If you put your projects below that in the folder hierarchy and use your own _.editorconfig_ there then the latter will take precedence and you can override the default rules. E.g. you can override certain analyzer rules for a whole folder (even a folder within a project) like this: ```editor-config -# All files -[*] +[*.{config,csproj,json,props,targets}] -guidelines = 150 1px solid a0ffc000, 180 1px solid 80ff0000 +indent_size = 4 ``` While eventually all analyzer rules in the .NET ecosystem will live in _.editorconfig_ this is not the case yet. However, you can override _.editorconfig_ rules from a ruleset file: You can open the ruleset file in Visual Studio and under the `Microsoft.CodeAnalysis.CSharp.Features` section you'll also be able to configure each IDE\* rule. From 88ae1359eed9b8c0a292c8017eabb701972c2f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 15:45:56 +0200 Subject: [PATCH 15/60] Code styling --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index 60ca908c..79f2cad8 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -71,6 +71,7 @@ You can also add the package to all projects inside a folder at once [from a _Di ``` + If you do this for multiple projects, it's recommended to add your own central props file (like _Analyzers.Build.props_) where you do the above and import that in each project instead. 3. The _NetFx.Build.props_ will copy this project's _.editorconfig_ file into every project folder that you've created a _Directory.Build.props_ in, so you might want to gitignore those: From 78b8cdfde065214a9db7558599b05829184d687d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 15:58:28 +0200 Subject: [PATCH 16/60] Fixing global_level of the VSIX globalconfig --- .../Lombiq.Analyzers.VisualStudioExtension.globalconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig index 037a538b..4e0d67fe 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig +++ b/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig @@ -1,5 +1,5 @@ is_global = true -global_level = 10 +global_level = 30 # General code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.General.globalconfig From 491a55e143d6954f510d73ec3128dab9e0a490e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 16:01:55 +0200 Subject: [PATCH 17/60] Not loading the General globalconfig twice for VS extensions --- Lombiq.Analyzers/VisualStudioExtension.Build.props | 1 - 1 file changed, 1 deletion(-) diff --git a/Lombiq.Analyzers/VisualStudioExtension.Build.props b/Lombiq.Analyzers/VisualStudioExtension.Build.props index 1385c956..6ad41825 100644 --- a/Lombiq.Analyzers/VisualStudioExtension.Build.props +++ b/Lombiq.Analyzers/VisualStudioExtension.Build.props @@ -1,6 +1,5 @@ - From 1252db99c81eb405d01c772129c7f29a176f1ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 19:22:39 +0200 Subject: [PATCH 18/60] Moving Orchard Core-related analyzer config to its own project --- ConvertTo-Nuspec.ps1 | 54 ++++++++++++------ Lombiq.Analyzers.OrchardCore/Build.props | 6 ++ Lombiq.Analyzers.OrchardCore/License.md | 13 +++++ .../Lombiq.Analyzers.OrchardCore.csproj | 30 ++++++++++ .../Lombiq.Analyzers.OrchardCore.globalconfig | 0 ...mbiq.Analyzers.OrchardCore.nuspec.template | 28 +++++++++ Lombiq.Analyzers.OrchardCore/NuGetIcon.png | Bin 0 -> 4657 bytes Lombiq.Analyzers.OrchardCore/Readme.md | 5 ++ .../build/Lombiq.Analyzers.OrchardCore.props | 7 +++ Lombiq.Analyzers.sln | 14 +++-- ...nPackages.props => AnalyzerPackages.props} | 0 Lombiq.Analyzers/Build.props | 5 +- ...alconfig => Lombiq.Analyzers.globalconfig} | 0 .../Lombiq.Analyzers.nuspec.template | 4 +- Readme.md | 2 +- 15 files changed, 139 insertions(+), 29 deletions(-) create mode 100644 Lombiq.Analyzers.OrchardCore/Build.props create mode 100644 Lombiq.Analyzers.OrchardCore/License.md create mode 100644 Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj rename {Lombiq.Analyzers => Lombiq.Analyzers.OrchardCore}/Lombiq.Analyzers.OrchardCore.globalconfig (100%) create mode 100644 Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template create mode 100644 Lombiq.Analyzers.OrchardCore/NuGetIcon.png create mode 100644 Lombiq.Analyzers.OrchardCore/Readme.md create mode 100644 Lombiq.Analyzers.OrchardCore/build/Lombiq.Analyzers.OrchardCore.props rename Lombiq.Analyzers/{CommonPackages.props => AnalyzerPackages.props} (100%) rename Lombiq.Analyzers/{Lombiq.Analyzers.General.globalconfig => Lombiq.Analyzers.globalconfig} (100%) diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index fc7f599e..bdf70ae4 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -1,24 +1,40 @@ param($Version) -$projectPath = Join-Path $PWD Lombiq.Analyzers -function Read-Xml([string]$File) { [xml](Get-Content (Join-Path $projectPath $File)) } +$packages = @( + "Lombiq.Analyzers", + "Lombiq.Analyzers.OrchardCore", + "Lombiq.Analyzers.Orchard1", + "Lombiq.Analyzers.VisualStudioExtension" +) -$nuspec = Read-Xml Lombiq.Analyzers.nuspec.template -$dependencies = $nuspec.package.metadata.dependencies - -$nuspec.package.metadata.GetElementsByTagName('version')[0].InnerXml = $Version - -foreach ($dependency in (Read-Xml CommonPackages.props).Project.ItemGroup.AnalyzerPackage) +# Iterate through the packages to replace +foreach ($package in $packages) { - $id = $dependency.Include - if (-not $id) { continue } - - $node = $nuspec.CreateElement('dependency') - $node.SetAttribute('id', $id) - $node.SetAttribute('version', $dependency.Version) - - $dependencies.AppendChild($node) + $projectPath = Join-Path $PWD $package + function Read-Xml([string]$File) { [xml](Get-Content (Join-Path $projectPath $File)) } + + $nuspec = Read-Xml "$package.nuspec.template" + $dependencies = $nuspec.package.metadata.dependencies + + $nuspec.package.metadata.GetElementsByTagName('version')[0].InnerXml = $Version + + # AnalyzerPackages.props is optional. + $analyzerPackagesPropsFile = Join-Path $projectPath "AnalyzerPackages.props" + if (Test-Path $analyzerPackagesPropsFile) + { + foreach ($dependency in (Read-Xml $analyzerPackagesPropsFile).Project.ItemGroup.AnalyzerPackage) + { + $id = $dependency.Include + if (-not $id) { continue } + + $node = $nuspec.CreateElement('dependency') + $node.SetAttribute('id', $id) + $node.SetAttribute('version', $dependency.Version) + + $dependencies.AppendChild($node) + } + } + + $outputPath = Join-Path $projectPath "$package.nuspec" + $nuspec.Save($outputPath) } - -$outputPath = Join-Path $projectPath Lombiq.Analyzers.nuspec -$nuspec.Save($outputPath) diff --git a/Lombiq.Analyzers.OrchardCore/Build.props b/Lombiq.Analyzers.OrchardCore/Build.props new file mode 100644 index 00000000..59007c73 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Build.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/Lombiq.Analyzers.OrchardCore/License.md b/Lombiq.Analyzers.OrchardCore/License.md new file mode 100644 index 00000000..2e53f494 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/License.md @@ -0,0 +1,13 @@ +Copyright © 2020, [Lombiq Technologies Ltd.](https://lombiq.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj new file mode 100644 index 00000000..20b1606f --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj @@ -0,0 +1,30 @@ + + + + netstandard2.0 + $(DefaultItemExcludes);.git*; + + License.md + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.OrchardCore.globalconfig b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig similarity index 100% rename from Lombiq.Analyzers/Lombiq.Analyzers.OrchardCore.globalconfig rename to Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template new file mode 100644 index 00000000..0cc8f798 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template @@ -0,0 +1,28 @@ + + + + Lombiq.Analyzers.OrchardCore + $version$ + Lombiq .NET Analyzers for Orchard Core + Lombiq Technologies + License.md + https://aka.ms/deprecateLicenseUrl + NuGetIcon.png + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.OrchardCore + Lombiq .NET Analyzers for Orchard Core: .NET code analyzers and code convention settings for Orchard Core (https://orchardcore.net/) apps. See the project website for detailed documentation. + Copyright © 2020, Lombiq Technologies Ltd. + OrchardCore Lombiq AspNetCore CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + + + + + + + + + + diff --git a/Lombiq.Analyzers.OrchardCore/NuGetIcon.png b/Lombiq.Analyzers.OrchardCore/NuGetIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..162a00508d8041833604d427216238c1b23b2d47 GIT binary patch literal 4657 zcmV-163*?3P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!Thn=~eB5))%gn$#O#QK7n$s4=L-h!O=vF^a;>Ff(Vme>2-ILt$p`^By>#th3Jf zo%mwTcYcq(e|sM=Ffi!HnCMv&IXStx>whD37Ty5YY(6YhyZU* z`lOOYjz@!+Y#0L27(o!^cm}spNxZ;7dL0%+0GcCv2#O=eyx?Vc`gIPV2NX&{?xE+f z^lJ~Gha`}M044qbL+Cjyh5$6L0{q&ILJ^D{pl{-(=dc(#fX0vrAa*1$6xZoFEQSZr z7(wvK@eI17ssIcRAOVts$TB0_jdpqtOTYI3UN3XFj3f*Ju%dMh;Pd&EP@s_mL<&Rz zN`wG)1dx-Hi@zU-9u4$`Y9Szs9MQo`12K>gq(l@_Ed*c%po9zSHwZo@h5^*`01;mT z`ZTTr{2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BAyJi zM^z7i;6A~PZEdPAe>UhD^*jJVya2wRcHaI2`y*!nzi%Vi1Be=|nlWQ$`b#hU-^;0~ nsrq~UR{!D^QUyrZxEtW_r%bs;&;Z{U00000NkvXXu0mjfi0rae literal 0 HcmV?d00001 diff --git a/Lombiq.Analyzers.OrchardCore/Readme.md b/Lombiq.Analyzers.OrchardCore/Readme.md new file mode 100644 index 00000000..9973ce56 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Readme.md @@ -0,0 +1,5 @@ +# Lombiq .NET Analyzers for Orchard Core + +## About + +.NET code analyzers and code convention settings for [Orchard Core](https://orchardcore.net/) projects. See [the root Readme](../Readme.md) for details on how to use the project. diff --git a/Lombiq.Analyzers.OrchardCore/build/Lombiq.Analyzers.OrchardCore.props b/Lombiq.Analyzers.OrchardCore/build/Lombiq.Analyzers.OrchardCore.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/build/Lombiq.Analyzers.OrchardCore.props @@ -0,0 +1,7 @@ + + + true + + + + diff --git a/Lombiq.Analyzers.sln b/Lombiq.Analyzers.sln index 4ea0a908..10c91eee 100644 --- a/Lombiq.Analyzers.sln +++ b/Lombiq.Analyzers.sln @@ -3,20 +3,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.Analyzers", "Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers", "Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.OrchardCore", "Lombiq.Analyzers.OrchardCore\Lombiq.Analyzers.OrchardCore.csproj", "{56EB2C63-4689-40E8-B967-8E78D401E25B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Debug|Any CPU.Build.0 = Debug|Any CPU {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Release|Any CPU.ActiveCfg = Release|Any CPU {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Release|Any CPU.Build.0 = Release|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal diff --git a/Lombiq.Analyzers/CommonPackages.props b/Lombiq.Analyzers/AnalyzerPackages.props similarity index 100% rename from Lombiq.Analyzers/CommonPackages.props rename to Lombiq.Analyzers/AnalyzerPackages.props diff --git a/Lombiq.Analyzers/Build.props b/Lombiq.Analyzers/Build.props index 14fa72cd..57937ea4 100644 --- a/Lombiq.Analyzers/Build.props +++ b/Lombiq.Analyzers/Build.props @@ -29,11 +29,10 @@ - - + - + diff --git a/Readme.md b/Readme.md index 1b67a9df..81655b85 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # Lombiq .NET Analyzers -[![Lombiq.Analyzers NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers?label=Lombiq.Analyzers)](https://www.nuget.org/packages/Lombiq.Analyzers/) +[![Lombiq.Analyzers NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers?label=Lombiq.Analyzers)](https://www.nuget.org/packages/Lombiq.Analyzers/) [![Lombiq.Analyzers.OrchardCore NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.OrchardCore?label=Lombiq.Analyzers)](https://www.nuget.org/packages/Lombiq.Analyzers.OrchardCore/) ## About From ad099eed0d3de89dec30f8344b4fbde8c41eb700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 19:29:48 +0200 Subject: [PATCH 19/60] Fixing path access --- ConvertTo-Nuspec.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index bdf70ae4..3a862b99 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -11,9 +11,9 @@ $packages = @( foreach ($package in $packages) { $projectPath = Join-Path $PWD $package - function Read-Xml([string]$File) { [xml](Get-Content (Join-Path $projectPath $File)) } + function Read-Xml([string]$File) { [xml](Get-Content (Join-Path $File)) } - $nuspec = Read-Xml "$package.nuspec.template" + $nuspec = Read-Xml (Join-Path $projectPath "$package.nuspec.template") $dependencies = $nuspec.package.metadata.dependencies $nuspec.package.metadata.GetElementsByTagName('version')[0].InnerXml = $Version From ccbc68e62503d48c859d43543bc3d2aade6c5b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 19:36:02 +0200 Subject: [PATCH 20/60] Updating project reference tests to reference the Orchard Core analyzer package since it's a more complex one --- .../Lombiq.Analyzers.ProjectReference.csproj | 2 +- .../Lombiq.Analyzers.ProjectReference.sln | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj index 19f387d4..2ab55bcf 100644 --- a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj @@ -1,6 +1,6 @@ - + net6.0 diff --git a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln index 80f6336c..6578ecc8 100644 --- a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln +++ b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln @@ -1,25 +1,24 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30114.105 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34202.233 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.Analyzers.ProjectReference", "Lombiq.Analyzers.ProjectReference.csproj", "{E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.ProjectReference", "Lombiq.Analyzers.ProjectReference.csproj", "{E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.Analyzers", "..\..\Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{E4090872-11F2-49D1-A746-65E15DC4977E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers", "..\..\Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{E4090872-11F2-49D1-A746-65E15DC4977E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CE857933-4E64-44B8-A1CA-3489F88475AB}" ProjectSection(SolutionItems) = preProject ..\Directory.Build.props = ..\Directory.Build.props EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.OrchardCore", "..\..\Lombiq.Analyzers.OrchardCore\Lombiq.Analyzers.OrchardCore.csproj", "{E1189194-7972-4A65-BFD5-82B55F17763D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -29,5 +28,12 @@ Global {E4090872-11F2-49D1-A746-65E15DC4977E}.Debug|Any CPU.Build.0 = Debug|Any CPU {E4090872-11F2-49D1-A746-65E15DC4977E}.Release|Any CPU.ActiveCfg = Release|Any CPU {E4090872-11F2-49D1-A746-65E15DC4977E}.Release|Any CPU.Build.0 = Release|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal From cb963685b7ed20c5e77f6c475e696b90734de35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 20:11:04 +0200 Subject: [PATCH 21/60] Docs --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index 79f2cad8..754aef30 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -1,5 +1,17 @@ # Adding analyzers to your project +## Selecting which analyzer project/package to use + +Lombiq .NET Analyzers is split into multiple projects/packages so you can select the one most suitable for your application. Depending on your use case, select one of the following: + +- `Lombiq.Analyzers`: General .NET projects. +- `Lombiq.Analyzers.NetFx`: .NET Framework projects. +- `Lombiq.Analyzers.OrchardCore`: [Orchard Core](https://orchardcore.net/) projects. +- `Lombiq.Analyzers.Orchard1`: Orchard 1 projects. +- `Lombiq.Analyzers.VisualStudioExtension`: Visual Studio extension projects. + +You only need to reference a single project; e.g., even though Orchard Core apps are also .NET apps, you only need to use `Lombiq.Analyzers.OrchardCore` for them. + ## How to add the analyzers to your whole repository of SDK-style projects 1. Add to _.gitmodules_ file (we use the _tools_ subfolder for the submodule's folder here but feel free to use something else): @@ -12,7 +24,7 @@ ``` _`path` can target anything but we suggest either the folder where the solution `.sln` file is located (mostly the repository root) or a "tools" subfolder therein._ -2. Create a _Directory.Build.props_ file in the folder where the solution _.sln_ file is located (mostly the repository root) with the following content (if you've put the submodule into a different folder then change the path): +2. Create a _Directory.Build.props_ file in the folder where the solution _.sln_ file is located (mostly the repository root) with the following content, referencing the analyzer project you selected above (if you've put the submodule into a different folder then change the path): ```xml @@ -26,14 +38,6 @@ /.editorconfig ``` -This will use the analyzer configuration suitable for Orchard Core projects. If you want to use the this in a non-Orchard .NET app then switch over to the general configuration by adding the following to the _Directory.Build.props_ file: - -```xml - - $(MSBuildThisFileDirectory)tools/Lombiq.Analyzers/general.ruleset - -``` - For at least Visual Studio and JetBrains Rider you don't need any further setup for IDE support. For [OmniSharp-integrated editors](http://www.omnisharp.net/#integrations) like Visual Studio Code you'll also need to add an _omnisharp.json_ file to the root of the solution: ```json @@ -49,7 +53,7 @@ For at least Visual Studio and JetBrains Rider you don't need any further setup ## How to add the analyzers to SDK-style projects from NuGet -The recommended approach for SDK-style projects is adding .NET Analyzers as a submodule as explained above due to the increased control you have over configuration. However, if you aren't using Git, dislike submodules or prefer NuGet, you can also use the [NuGet package](https://www.nuget.org/packages/Lombiq.Analyzers/) to install it for just one project. Once you add the package to your project, all analyzers will be applied. Check for the latest version number [on NuGet](https://www.nuget.org/packages/Lombiq.Analyzers/). +If you don't want to stay on the cutting-edge version, nor do you intend to contribute to Lombiq .NET Analyzers, you can use one of the NuGet packages. Install the package suitable for your project, as selected above. Check for the latest version number [on NuGet](https://www.nuget.org/packages/Lombiq.Analyzers/). ```csproj @@ -64,11 +68,11 @@ You can also add the package to all projects inside a folder at once [from a _Di ## How to add the analyzers to individual non-SDK-style .NET Framework projects (not solutions) 1. Same as above - add the .NET-Analyzers repository as a submodule to your repository. -2. Create a _Directory.Build.props_ file in every project folder you want to target, next to the _.csproj_ file with the following content (import the _NetFx.Build.props_ file instead of _Build.props_, adjust the relative path as suitable): +2. Create a _Directory.Build.props_ file in every project folder you want to target, next to the _.csproj_ file with the following content, either referencing `Lombiq.Analyzers.NetFx` or `Lombiq.Analyzers.Orchard1` (adjust the relative path as suitable): ```xml - + ``` @@ -80,8 +84,6 @@ You can also add the package to all projects inside a folder at once [from a _Di .editorconfig ``` -This will use the analyzer configuration suitable for Orchard 1 projects. If you want to use this in a non-Orchard .NET Framework app then use the _general.ruleset_ file as described above. - ## Introducing analyzers to an existing project What to do if you're not starting a green-field project but want to add analyzers to an existing (large) project? From 7e7afccbb2953770f362bf41f594e2950b33805c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 20:11:40 +0200 Subject: [PATCH 22/60] Adding .NET Framework .globalconfig file too --- .../Lombiq.Analyzers.OrchardCore.globalconfig | 2 +- .../Lombiq.Analyzers.NetFx.globalconfig | 13 +++++++++++++ .../Lombiq.Analyzers.Orchard1.globalconfig | 5 ++--- ...biq.Analyzers.VisualStudioExtension.globalconfig | 4 ++-- Lombiq.Analyzers/Lombiq.Analyzers.globalconfig | 2 +- 5 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 Lombiq.Analyzers/Lombiq.Analyzers.NetFx.globalconfig diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig index 9cf9fbca..10653d62 100644 --- a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig @@ -1,7 +1,7 @@ is_global = true global_level = 10 -# General code analysis rules for Orchard Core projects, extending Lombiq.Analyzers.General.globalconfig +# Code analysis rules for Orchard Core projects, extending Lombiq.Analyzers.globalconfig. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and # rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.NetFx.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.NetFx.globalconfig new file mode 100644 index 00000000..0bb1d45b --- /dev/null +++ b/Lombiq.Analyzers/Lombiq.Analyzers.NetFx.globalconfig @@ -0,0 +1,13 @@ +is_global = true +global_level = 10 + +# General code analysis rules for .NET Framework projects, extending Lombiq.Analyzers.globalconfig. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA1016.severity = none + +# SonarAnalyzer.CSharp rules +dotnet_diagnostic.S3904.severity = none diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig index 5ff0521e..ab489fd0 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig +++ b/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig @@ -1,18 +1,17 @@ is_global = true global_level = 20 -# General code analysis rules for Orchard 1 projects, extending Lombiq.Analyzers.General.globalconfig +# Code analysis rules for Orchard 1 projects, extending Lombiq.Analyzers.NetFx.globalconfig and +# Lombiq.Analyzers.OrchardCore.globalconfig. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and # rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. # Microsoft.CodeAnalysis.NetAnalyzers rules -dotnet_diagnostic.CA1016.severity = none dotnet_diagnostic.CA3147.severity = none # SecurityCodeScan.VS2019 rules dotnet_diagnostic.SCS0016.severity = none # SonarAnalyzer.CSharp rules -dotnet_diagnostic.S3904.severity = none dotnet_diagnostic.S4564.severity = none diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig index 4e0d67fe..22316ec2 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig +++ b/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig @@ -1,7 +1,7 @@ is_global = true -global_level = 30 +global_level = 20 -# General code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.General.globalconfig +# Code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.NetFx.globalconfig. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and # rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig index 324f7803..07068606 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig +++ b/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig @@ -1,7 +1,7 @@ is_global = true global_level = 0 -# General code analysis rules for any .NET project. +# General code analysis rules for any .NET and .NET Framework project. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and # rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. From 6530848aad19a5e0b8468f84a23f7270d0981918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 20:27:37 +0200 Subject: [PATCH 23/60] PS syntax --- ConvertTo-Nuspec.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index 3a862b99..27b2d226 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -11,7 +11,7 @@ $packages = @( foreach ($package in $packages) { $projectPath = Join-Path $PWD $package - function Read-Xml([string]$File) { [xml](Get-Content (Join-Path $File)) } + function Read-Xml([string]$File) { [xml](Get-Content $File) } $nuspec = Read-Xml (Join-Path $projectPath "$package.nuspec.template") $dependencies = $nuspec.package.metadata.dependencies From 11c1c23f853e28eb092325e55e300fe722c3bd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 20:32:19 +0200 Subject: [PATCH 24/60] Removing future project references --- ConvertTo-Nuspec.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index 27b2d226..96704769 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -2,9 +2,7 @@ $packages = @( "Lombiq.Analyzers", - "Lombiq.Analyzers.OrchardCore", - "Lombiq.Analyzers.Orchard1", - "Lombiq.Analyzers.VisualStudioExtension" + "Lombiq.Analyzers.OrchardCore" ) # Iterate through the packages to replace From 28e82fd0c8d5daf942ec26316e9b416856b407a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 20:41:45 +0200 Subject: [PATCH 25/60] Updating NuGet reference in test solution --- .../IndirectPackageReference/IndirectPackageReference.csproj | 2 +- .../Lombiq.Analyzers.PackageReference.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj index 58ba2a85..32ed2ddf 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj @@ -10,7 +10,7 @@ --> - + all diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj index 27f1c1aa..88528bd5 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj @@ -5,7 +5,7 @@ - + all From 4ab8e2db1e1ae5a1842591d4b9dcdad87c6e3bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 20:48:10 +0200 Subject: [PATCH 26/60] PS analyzer violation fixes --- ConvertTo-Nuspec.ps1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index 96704769..60689fe9 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -1,8 +1,11 @@ param($Version) $packages = @( - "Lombiq.Analyzers", - "Lombiq.Analyzers.OrchardCore" + 'Lombiq.Analyzers', + 'Lombiq.Analyzers.NetFx', + 'Lombiq.Analyzers.OrchardCore', + 'Lombiq.Analyzers.Orchard1', + 'Lombiq.Analyzers.VisualStudioExtension' ) # Iterate through the packages to replace @@ -10,25 +13,25 @@ foreach ($package in $packages) { $projectPath = Join-Path $PWD $package function Read-Xml([string]$File) { [xml](Get-Content $File) } - + $nuspec = Read-Xml (Join-Path $projectPath "$package.nuspec.template") $dependencies = $nuspec.package.metadata.dependencies - + $nuspec.package.metadata.GetElementsByTagName('version')[0].InnerXml = $Version - + # AnalyzerPackages.props is optional. - $analyzerPackagesPropsFile = Join-Path $projectPath "AnalyzerPackages.props" + $analyzerPackagesPropsFile = Join-Path $projectPath 'AnalyzerPackages.props' if (Test-Path $analyzerPackagesPropsFile) { foreach ($dependency in (Read-Xml $analyzerPackagesPropsFile).Project.ItemGroup.AnalyzerPackage) { $id = $dependency.Include if (-not $id) { continue } - + $node = $nuspec.CreateElement('dependency') $node.SetAttribute('id', $id) $node.SetAttribute('version', $dependency.Version) - + $dependencies.AppendChild($node) } } From 006b9d335242357d6bd7d10f8d010943ad2de9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:00:12 +0200 Subject: [PATCH 27/60] Adding missing dependency to Lombiq.Analyzers from Lombiq.Analyzers.OrchardCore --- .../Lombiq.Analyzers.OrchardCore.nuspec.template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template index 0cc8f798..0855d32c 100644 --- a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template @@ -14,7 +14,8 @@ OrchardCore Lombiq AspNetCore CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop - + + From 4fb18c97659bd3c3e602d0c8fefc89df216317fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:02:24 +0200 Subject: [PATCH 28/60] Again removing future project references --- ConvertTo-Nuspec.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index 60689fe9..0f6b8382 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -2,10 +2,7 @@ $packages = @( 'Lombiq.Analyzers', - 'Lombiq.Analyzers.NetFx', - 'Lombiq.Analyzers.OrchardCore', - 'Lombiq.Analyzers.Orchard1', - 'Lombiq.Analyzers.VisualStudioExtension' + 'Lombiq.Analyzers.OrchardCore' ) # Iterate through the packages to replace From db2fc52c5456dbc478d71d445e078f9111fcb332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:17:26 +0200 Subject: [PATCH 29/60] Fixing Lombiq.Analyzers reference --- .../Lombiq.Analyzers.OrchardCore.nuspec.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template index 0855d32c..0a679ed1 100644 --- a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template @@ -15,7 +15,7 @@ - + From 9cf3552b1da8fc82def0877695f5fbe4eeb5edf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:18:55 +0200 Subject: [PATCH 30/60] Leftover docs --- .../Lombiq.Analyzers.OrchardCore.csproj | 2 +- Lombiq.Analyzers/Lombiq.Analyzers.csproj | 2 +- Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj index 20b1606f..16cebd4b 100644 --- a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj @@ -10,7 +10,7 @@ diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.csproj b/Lombiq.Analyzers/Lombiq.Analyzers.csproj index c1c66e7a..c7bf0c7b 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.csproj +++ b/Lombiq.Analyzers/Lombiq.Analyzers.csproj @@ -10,7 +10,7 @@ diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template b/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template index 1adf9378..dd303e16 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template +++ b/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template @@ -14,7 +14,7 @@ Lombiq CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop - + From d8c79f2bc57204c1b94e07674a1128d7009341be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:21:25 +0200 Subject: [PATCH 31/60] Adding Lombiq.Analyzers.NetFx --- ConvertTo-Nuspec.ps1 | 1 + .../Build.props | 7 ++-- Lombiq.Analyzers.NetFx/License.md | 13 +++++++ .../Lombiq.Analyzers.NetFx.csproj | 34 ++++++++++++++++++ .../Lombiq.Analyzers.NetFx.globalconfig | 0 .../Lombiq.Analyzers.NetFx.nuspec.template | 29 +++++++++++++++ Lombiq.Analyzers.NetFx/NuGetIcon.png | Bin 0 -> 4657 bytes Lombiq.Analyzers.NetFx/Readme.md | 5 +++ .../build/Lombiq.Analyzers.NetFx.props | 7 ++++ .../Lombiq.Analyzers.NetFx.1.2.3.nupkg | Bin 0 -> 17438 bytes Lombiq.Analyzers/Build.props | 5 --- 11 files changed, 92 insertions(+), 9 deletions(-) rename Lombiq.Analyzers/NetFx.Build.props => Lombiq.Analyzers.NetFx/Build.props (94%) create mode 100644 Lombiq.Analyzers.NetFx/License.md create mode 100644 Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj rename {Lombiq.Analyzers => Lombiq.Analyzers.NetFx}/Lombiq.Analyzers.NetFx.globalconfig (100%) create mode 100644 Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template create mode 100644 Lombiq.Analyzers.NetFx/NuGetIcon.png create mode 100644 Lombiq.Analyzers.NetFx/Readme.md create mode 100644 Lombiq.Analyzers.NetFx/build/Lombiq.Analyzers.NetFx.props create mode 100644 Lombiq.Analyzers.NetFx/publish/Lombiq.Analyzers.NetFx.1.2.3.nupkg diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index 0f6b8382..bc6b99e9 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -2,6 +2,7 @@ $packages = @( 'Lombiq.Analyzers', + 'Lombiq.Analyzers.NetFx', 'Lombiq.Analyzers.OrchardCore' ) diff --git a/Lombiq.Analyzers/NetFx.Build.props b/Lombiq.Analyzers.NetFx/Build.props similarity index 94% rename from Lombiq.Analyzers/NetFx.Build.props rename to Lombiq.Analyzers.NetFx/Build.props index ad5513ca..fc44bbdd 100644 --- a/Lombiq.Analyzers/NetFx.Build.props +++ b/Lombiq.Analyzers.NetFx/Build.props @@ -28,12 +28,11 @@ - - - + + - + + License.md + + + + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.NetFx.globalconfig b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig similarity index 100% rename from Lombiq.Analyzers/Lombiq.Analyzers.NetFx.globalconfig rename to Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig diff --git a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template new file mode 100644 index 00000000..393781fc --- /dev/null +++ b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template @@ -0,0 +1,29 @@ + + + + Lombiq.Analyzers.NetFx + $version$ + Lombiq .NET Analyzers for .NET Framework + Lombiq Technologies + License.md + https://aka.ms/deprecateLicenseUrl + NuGetIcon.png + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.NetFx + Lombiq .NET Analyzers for .NET Framework: .NET code analyzers and code convention settings for .NET Framework projects. See the project website for detailed documentation. + Copyright © 2020, Lombiq Technologies Ltd. + NetFx Lombiq AspNetCore CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + + + + + + + + + + diff --git a/Lombiq.Analyzers.NetFx/NuGetIcon.png b/Lombiq.Analyzers.NetFx/NuGetIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..162a00508d8041833604d427216238c1b23b2d47 GIT binary patch literal 4657 zc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=Jy1xT=@_T9LTpwqP?pFHk{^vhmP7rg~$OA zoBCq`s)Yci_&;jYD0tw32dKr)hSMKFy9#aDQn7^z0e#s6FbP0Rn^(j2X4v+14Yl-5 z*bvZ%lfbYE;IwJeVCvMV)MDo;lK6>jyi}X0a2`N?0qDa6*ladYZC?9ZkHg`%dTQyP za8-b-2)21u zbGLcjWSoRuI@DxZawe?Je2`kY|Ev_cpZ#XZBU z8qpRzl&8;uCnh}Rs9 zN??l;(X_eSVawS)aN^q6x)}?Iu|&aLNn>Enuxv<@C{SD@aJc0gIC8liuDLyO_c!{R zJKV`n&loRyC5mVPl$Di<%KQyv1;@^DcQDc49G(!+LeG$xlmttb@V9vx$WDiphmY_G z;4nQy0g3&*ZC(b7ASnSvcm#m2v<$3^nmBPHo(!}{QUZuD3!t{P28Zl6;B{hRBAyJi zM^z7i;6A~PZEdPAe>UhD^*jJVya2wRcHaI2`y*!nzi%Vi1Be=|nlWQ$`b#hU-^;0~ nsrq~UR{!D^QUyrZxEtW_r%bs;&;Z{U00000NkvXXu0mjfi0rae literal 0 HcmV?d00001 diff --git a/Lombiq.Analyzers.NetFx/Readme.md b/Lombiq.Analyzers.NetFx/Readme.md new file mode 100644 index 00000000..6c78b607 --- /dev/null +++ b/Lombiq.Analyzers.NetFx/Readme.md @@ -0,0 +1,5 @@ +# Lombiq .NET Analyzers for .NET Framework + +## About + +.NET code analyzers and code convention settings for .NET Framework projects. See [the root Readme](../Readme.md) for details on how to use the project. diff --git a/Lombiq.Analyzers.NetFx/build/Lombiq.Analyzers.NetFx.props b/Lombiq.Analyzers.NetFx/build/Lombiq.Analyzers.NetFx.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.NetFx/build/Lombiq.Analyzers.NetFx.props @@ -0,0 +1,7 @@ + + + true + + + + diff --git a/Lombiq.Analyzers.NetFx/publish/Lombiq.Analyzers.NetFx.1.2.3.nupkg b/Lombiq.Analyzers.NetFx/publish/Lombiq.Analyzers.NetFx.1.2.3.nupkg new file mode 100644 index 0000000000000000000000000000000000000000..0cdfe59c9628ec9dd0c419c8de811b0614bb7651 GIT binary patch literal 17438 zcmcJ%WpE|Ck_LE=nVFg0W@cu#+sw?&%*@bcW^S|F%xz|7hPK^pX13RNUQFCOGw((0 z{@8Our6@`HMOBuRlCtuvuQH%uXaE2J3gA;AqdpxHxJv;90Kh;10NBq`eJ4{JX9oJe zj>+HFtw5NN!Y*Ka!xOwYn7o~$zn80iN!E*CKx#~4TfoZ{o#pohZOWG{=)yC5kN+?p znors)B7MxSvblRROIx4h+Z)akq-fGYYy@}3!pie7+Azm|=^q1c471wms>QPmAl?g+tC61FaE zQ$!ISu;}+itRFmB{8RlrVitBWoi|G79o))odWeJv6{FXVQHv?Y^gT?5U27`uXk0N6 z`N_J--xCG?n>())NmY2@4b@puki+5wC4MhqO29Ttu`xM=X3jGHNYGek0XYr%cgyZc zQ)Sf**ml(OJxS-WKZ`~~nT6C@+#hauNm=Id-Ji<(_y7fb{U7R#pYY$Y`c$XUr#kUJ zTgckm8d*Bh3)vakczT&SIn&FVx`=zw+qpVBm>Rn%jm!5lB6X5pA*NoeNWqkd$y1Z< zs1TFwfa-WBX~hz*(EoVFf#i?W?*+Dilf`wg@MPv}#<#e$uOAce1tX4S;-nS#LdDc6 zWz-CvtmMjGR&ntg#YLlE0La^++4P2v>A%1mL1#i1rd+bGu%j5Vy&Y13YoVKpMKiIT z>=dLYRqvVUB^J02S+X0H%`in#V8GE4dUcAM>~;}9_=^&7LFT$ z8WJOiWwInGta zBe4g1YW>EireQh$CydYgg|z+v*1Z4wkTPV{{SEk_9Kk=U5C8zW&&qU!}O^ix9x}1{y zRRBw)dkbkJ%lHJX8KYVXiD^sPKNn&b`FH$RatyjB-E9x;%+AjC zexnErl@}?#MTJ^nCtd|s%!{>cm1mW0T)NdBVx?y*^|tzG#(s$w;*pBNQxdyd`gr=#)kLaD%-?vYfxrNG*-07ts5%nTsUE<0i zH{k$BA3}0VP>=0e1N0-qS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D!1r(M`aiGeFM$7T?fwSH;s5`^_I;HB|0@Ut0QdR#{*1 --> - - - - - From 8a29ce66b2254bfffabd73b04c1cda664e11d1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:23:46 +0200 Subject: [PATCH 32/60] Docs --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 81655b85..88ab771e 100644 --- a/Readme.md +++ b/Readme.md @@ -64,7 +64,7 @@ When a new version of the .NET SDK comes out then to the following: - Change the `LangVersion` and `AnalysisLevel` elements in the _Build.props_ file to opt in to new language features and analyzers. This does not concern non-SDK-style .NET Framework projects. - Wait for all analyzers to support the new SDK (primarily the new language features). Then update all packages to latest. -- Check if there are new [code analysis categories](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories) that we need to surface warnings for by default in the main _.globalconfig_ file. +- Check if there are new [code analysis categories](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories) that we need to surface warnings for by default in the _Lombiq.Analyzers.globalconfig_ file. ### Adding a new analyzer From 0502175f28f0b193c052fe6a9ed2bc4f179fcb94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:23:56 +0200 Subject: [PATCH 33/60] Updating NuGet versions --- .../IndirectPackageReference/IndirectPackageReference.csproj | 2 +- .../Lombiq.Analyzers.PackageReference.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj index 32ed2ddf..dd63db3e 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj @@ -10,7 +10,7 @@ --> - + all diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj index 88528bd5..9251864d 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj @@ -5,7 +5,7 @@ - + all From 12dafd7df6220b5749a406763d9470ef1b585c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:27:30 +0200 Subject: [PATCH 34/60] Adding more files to the NetFx project --- Lombiq.Analyzers.NetFx/Build.props | 8 ++++---- Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Lombiq.Analyzers.NetFx/Build.props b/Lombiq.Analyzers.NetFx/Build.props index fc44bbdd..97aa1477 100644 --- a/Lombiq.Analyzers.NetFx/Build.props +++ b/Lombiq.Analyzers.NetFx/Build.props @@ -28,11 +28,11 @@ - + - + + + + + + + From 75d951d4d8f0e55960cbc97cafc2a71900e7a81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:29:22 +0200 Subject: [PATCH 35/60] Fixing NetFx .editorconfig path --- Lombiq.Analyzers.NetFx/Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers.NetFx/Build.props b/Lombiq.Analyzers.NetFx/Build.props index 97aa1477..27bf9c30 100644 --- a/Lombiq.Analyzers.NetFx/Build.props +++ b/Lombiq.Analyzers.NetFx/Build.props @@ -64,6 +64,6 @@ - + From c2bab1185312c7c8e37bb02f07e335d2f8a3abf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:36:03 +0200 Subject: [PATCH 36/60] PS analyzer violation fix --- ConvertTo-Nuspec.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index bc6b99e9..a987b983 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -33,7 +33,7 @@ foreach ($package in $packages) $dependencies.AppendChild($node) } } - + $outputPath = Join-Path $projectPath "$package.nuspec" $nuspec.Save($outputPath) } From 4c9b833285ce4651868a13c45d0b1873d8275adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:50:15 +0200 Subject: [PATCH 37/60] Adding Orchard 1 project --- ConvertTo-Nuspec.ps1 | 3 +- Lombiq.Analyzers.Orchard1/Build.props | 6 ++++ Lombiq.Analyzers.Orchard1/License.md | 13 ++++++++ .../Lombiq.Analyzers.Orchard1.csproj | 30 ++++++++++++++++++ .../Lombiq.Analyzers.Orchard1.globalconfig | 0 .../Lombiq.Analyzers.Orchard1.nuspec.template | 29 +++++++++++++++++ Lombiq.Analyzers.Orchard1/NuGetIcon.png | Bin 0 -> 4657 bytes Lombiq.Analyzers.Orchard1/Readme.md | 6 ++++ .../build/Lombiq.Analyzers.Orchard1.props | 7 ++++ Lombiq.Analyzers.sln | 15 +++++++++ .../Lombiq.Analyzers.nuspec.template | 2 +- Lombiq.Analyzers/Readme.md | 5 +++ 12 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 Lombiq.Analyzers.Orchard1/Build.props create mode 100644 Lombiq.Analyzers.Orchard1/License.md create mode 100644 Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj rename {Lombiq.Analyzers => Lombiq.Analyzers.Orchard1}/Lombiq.Analyzers.Orchard1.globalconfig (100%) create mode 100644 Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.nuspec.template create mode 100644 Lombiq.Analyzers.Orchard1/NuGetIcon.png create mode 100644 Lombiq.Analyzers.Orchard1/Readme.md create mode 100644 Lombiq.Analyzers.Orchard1/build/Lombiq.Analyzers.Orchard1.props create mode 100644 Lombiq.Analyzers/Readme.md diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index a987b983..db75785f 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -3,7 +3,8 @@ $packages = @( 'Lombiq.Analyzers', 'Lombiq.Analyzers.NetFx', - 'Lombiq.Analyzers.OrchardCore' + 'Lombiq.Analyzers.OrchardCore', + 'Lombiq.Analyzers.Orchard1' ) # Iterate through the packages to replace diff --git a/Lombiq.Analyzers.Orchard1/Build.props b/Lombiq.Analyzers.Orchard1/Build.props new file mode 100644 index 00000000..3363260c --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Build.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/Lombiq.Analyzers.Orchard1/License.md b/Lombiq.Analyzers.Orchard1/License.md new file mode 100644 index 00000000..2e53f494 --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/License.md @@ -0,0 +1,13 @@ +Copyright © 2020, [Lombiq Technologies Ltd.](https://lombiq.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj new file mode 100644 index 00000000..16cebd4b --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj @@ -0,0 +1,30 @@ + + + + netstandard2.0 + $(DefaultItemExcludes);.git*; + + License.md + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig similarity index 100% rename from Lombiq.Analyzers/Lombiq.Analyzers.Orchard1.globalconfig rename to Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.nuspec.template b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.nuspec.template new file mode 100644 index 00000000..54ff64f2 --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.nuspec.template @@ -0,0 +1,29 @@ + + + + Lombiq.Analyzers.Orchard1 + $version$ + Lombiq .NET Analyzers for Orchard 1 + Lombiq Technologies + License.md + https://aka.ms/deprecateLicenseUrl + NuGetIcon.png + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.Orchard1 + Lombiq .NET Analyzers for Orchard 1: .NET code analyzers and code convention settings for Orchard 1 (https://orchardcore.net/orchardcms) apps. See the project website for detailed documentation. + Copyright © 2020, Lombiq Technologies Ltd. + Orchard Lombiq AspNet CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + + + + + + + + + + + diff --git a/Lombiq.Analyzers.Orchard1/NuGetIcon.png b/Lombiq.Analyzers.Orchard1/NuGetIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..162a00508d8041833604d427216238c1b23b2d47 GIT binary patch literal 4657 zcmV-163*?3P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!Thn=~eB5))%gn$#O#QK7n$s4=L-h!O=vF^a;>Ff(Vme>2-ILt$p`^By>#th3Jf zo%mwTcYcq(e|sM=Ffi!HnCMv&IXStx>whD37Ty5YY(6YhyZU* z`lOOYjz@!+Y#0L27(o!^cm}spNxZ;7dL0%+0GcCv2#O=eyx?Vc`gIPV2NX&{?xE+f z^lJ~Gha`}M044qbL+Cjyh5$6L0{q&ILJ^D{pl{-(=dc(#fX0vrAa*1$6xZoFEQSZr z7(wvK@eI17ssIcRAOVts$TB0_jdpqtOTYI3UN3XFj3f*Ju%dMh;Pd&EP@s_mL<&Rz zN`wG)1dx-Hi@zU-9u4$`Y9Szs9MQo`12K>gq(l@_Ed*c%po9zSHwZo@h5^*`01;mT z`ZTTr{2)t5P^2*{ z(gugaA-4-MJOC@WCeUuzc2!$!Tr9nk4OKlrL<=A$CPveRp~&DtgXxuQsOkYCIs_yq zi&{?^z~AA7u04mq{oY>iHJqn+`58HKgxn#(@Bplg966F+@!_re3a*ts4jq4d89JYP z9onnbLFfOxj>C%dSFkgE`n~i@HjEsAm1)zb(JOZRolfXj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Orchard1/Readme.md new file mode 100644 index 00000000..7428f74f --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Readme.md @@ -0,0 +1,6 @@ +# Lombiq .NET Analyzers for Orchard Core + +## About + +.NET code analyzers and code convention settings for [Orchard 1](https://orchardcore.net/orchardcms) projects. See [the root Readme](../Readme.md) for details on how to use the project. + diff --git a/Lombiq.Analyzers.Orchard1/build/Lombiq.Analyzers.Orchard1.props b/Lombiq.Analyzers.Orchard1/build/Lombiq.Analyzers.Orchard1.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/build/Lombiq.Analyzers.Orchard1.props @@ -0,0 +1,7 @@ + + + true + + + + diff --git a/Lombiq.Analyzers.sln b/Lombiq.Analyzers.sln index 10c91eee..89c02a60 100644 --- a/Lombiq.Analyzers.sln +++ b/Lombiq.Analyzers.sln @@ -7,6 +7,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers", "Lombiq. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.OrchardCore", "Lombiq.Analyzers.OrchardCore\Lombiq.Analyzers.OrchardCore.csproj", "{56EB2C63-4689-40E8-B967-8E78D401E25B}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.NetFx", "Lombiq.Analyzers.NetFx\Lombiq.Analyzers.NetFx.csproj", "{5706CF69-091E-4F97-A6CE-3440F9CEACC7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.Orchard1", "Lombiq.Analyzers.Orchard1\Lombiq.Analyzers.Orchard1.csproj", "{0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,8 +25,19 @@ Global {56EB2C63-4689-40E8-B967-8E78D401E25B}.Debug|Any CPU.Build.0 = Debug|Any CPU {56EB2C63-4689-40E8-B967-8E78D401E25B}.Release|Any CPU.ActiveCfg = Release|Any CPU {56EB2C63-4689-40E8-B967-8E78D401E25B}.Release|Any CPU.Build.0 = Release|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Release|Any CPU.Build.0 = Release|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CF592D6A-8CAC-4389-89C7-593C104DB561} + EndGlobalSection EndGlobal diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template b/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template index dd303e16..cebcf5b5 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template +++ b/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template @@ -8,7 +8,7 @@ License.md https://aka.ms/deprecateLicenseUrl NuGetIcon.png - https://github.com/Lombiq/.NET-Analyzers + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers Lombiq .NET Analyzers: .NET code analyzers and code convention settings for general .NET projects. See the project website for detailed documentation. Copyright © 2020, Lombiq Technologies Ltd. Lombiq CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop diff --git a/Lombiq.Analyzers/Readme.md b/Lombiq.Analyzers/Readme.md new file mode 100644 index 00000000..5a4d3a30 --- /dev/null +++ b/Lombiq.Analyzers/Readme.md @@ -0,0 +1,5 @@ +# Lombiq .NET Analyzers + +## About + +.NET code analyzers and code convention settings for general .NET projects. See [the root Readme](../Readme.md) for details on how to use the project. From 184705cd521d3fb4eddc83e9241be78fbb45842c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:54:23 +0200 Subject: [PATCH 38/60] Project links in docs --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index 754aef30..3ff4362c 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -4,11 +4,11 @@ Lombiq .NET Analyzers is split into multiple projects/packages so you can select the one most suitable for your application. Depending on your use case, select one of the following: -- `Lombiq.Analyzers`: General .NET projects. -- `Lombiq.Analyzers.NetFx`: .NET Framework projects. -- `Lombiq.Analyzers.OrchardCore`: [Orchard Core](https://orchardcore.net/) projects. -- `Lombiq.Analyzers.Orchard1`: Orchard 1 projects. -- `Lombiq.Analyzers.VisualStudioExtension`: Visual Studio extension projects. +- [`Lombiq.Analyzers`](../Readme.md): General .NET projects. +- [`Lombiq.Analyzers.NetFx`](../..Lombiq.Analyzers.NetFx/Readme.md): .NET Framework projects. +- [`Lombiq.Analyzers.OrchardCore`](../..Lombiq.Analyzers.OrchardCore/Readme.md): [Orchard Core](https://orchardcore.net/) projects. +- [`Lombiq.Analyzers.Orchard1`](../..Lombiq.Analyzers.Orchard1/Readme.md): Orchard 1 projects. +- [`Lombiq.Analyzers.VisualStudioExtension`](../..Lombiq.Analyzers.VisualStudioExtension/Readme.md): Visual Studio extension projects. You only need to reference a single project; e.g., even though Orchard Core apps are also .NET apps, you only need to use `Lombiq.Analyzers.OrchardCore` for them. From 339d077d4b6d67eb4895668f0c47215549e14bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 21:55:11 +0200 Subject: [PATCH 39/60] Fixing links --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index 3ff4362c..c850e90f 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -5,10 +5,10 @@ Lombiq .NET Analyzers is split into multiple projects/packages so you can select the one most suitable for your application. Depending on your use case, select one of the following: - [`Lombiq.Analyzers`](../Readme.md): General .NET projects. -- [`Lombiq.Analyzers.NetFx`](../..Lombiq.Analyzers.NetFx/Readme.md): .NET Framework projects. -- [`Lombiq.Analyzers.OrchardCore`](../..Lombiq.Analyzers.OrchardCore/Readme.md): [Orchard Core](https://orchardcore.net/) projects. -- [`Lombiq.Analyzers.Orchard1`](../..Lombiq.Analyzers.Orchard1/Readme.md): Orchard 1 projects. -- [`Lombiq.Analyzers.VisualStudioExtension`](../..Lombiq.Analyzers.VisualStudioExtension/Readme.md): Visual Studio extension projects. +- [`Lombiq.Analyzers.NetFx`](../../Lombiq.Analyzers.NetFx/Readme.md): .NET Framework projects. +- [`Lombiq.Analyzers.OrchardCore`](../../Lombiq.Analyzers.OrchardCore/Readme.md): [Orchard Core](https://orchardcore.net/) projects. +- [`Lombiq.Analyzers.Orchard1`](../../Lombiq.Analyzers.Orchard1/Readme.md): Orchard 1 projects. +- [`Lombiq.Analyzers.VisualStudioExtension`](../../Lombiq.Analyzers.VisualStudioExtension/Readme.md): Visual Studio extension projects. You only need to reference a single project; e.g., even though Orchard Core apps are also .NET apps, you only need to use `Lombiq.Analyzers.OrchardCore` for them. From 03bbd127868a5c1b04ffffe252fea618896061a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 22:04:32 +0200 Subject: [PATCH 40/60] Orchard1 also need OrchardCore rules --- Lombiq.Analyzers.Orchard1/Build.props | 1 + Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/Lombiq.Analyzers.Orchard1/Build.props b/Lombiq.Analyzers.Orchard1/Build.props index 3363260c..743450e6 100644 --- a/Lombiq.Analyzers.Orchard1/Build.props +++ b/Lombiq.Analyzers.Orchard1/Build.props @@ -1,6 +1,7 @@ + diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj index 16cebd4b..45a97a36 100644 --- a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj @@ -15,6 +15,7 @@ --> + From fb5ba460f0df40c5cd7eb4973390a3ae395e060e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 22:15:18 +0200 Subject: [PATCH 41/60] Adding VSIX project --- ConvertTo-Nuspec.ps1 | 3 +- .../Build.props | 6 ++++ .../License.md | 13 ++++++++ ...biq.Analyzers.VisualStudioExtension.csproj | 30 ++++++++++++++++++ ...alyzers.VisualStudioExtension.globalconfig | 10 ++++++ ...zers.VisualStudioExtension.nuspec.template | 29 +++++++++++++++++ .../NuGetIcon.png | Bin 0 -> 4657 bytes .../Readme.md | 6 ++++ ...mbiq.Analyzers.VisualStudioExtension.props | 7 ++++ Lombiq.Analyzers.sln | 6 ++++ 10 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 Lombiq.Analyzers.VisualStudioExtension/Build.props create mode 100644 Lombiq.Analyzers.VisualStudioExtension/License.md create mode 100644 Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.csproj create mode 100644 Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig create mode 100644 Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template create mode 100644 Lombiq.Analyzers.VisualStudioExtension/NuGetIcon.png create mode 100644 Lombiq.Analyzers.VisualStudioExtension/Readme.md create mode 100644 Lombiq.Analyzers.VisualStudioExtension/build/Lombiq.Analyzers.VisualStudioExtension.props diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index db75785f..7eaaed06 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -4,7 +4,8 @@ $packages = @( 'Lombiq.Analyzers', 'Lombiq.Analyzers.NetFx', 'Lombiq.Analyzers.OrchardCore', - 'Lombiq.Analyzers.Orchard1' + 'Lombiq.Analyzers.Orchard1', + 'Lombiq.Analyzers.VisualStudioExtension' ) # Iterate through the packages to replace diff --git a/Lombiq.Analyzers.VisualStudioExtension/Build.props b/Lombiq.Analyzers.VisualStudioExtension/Build.props new file mode 100644 index 00000000..773ec19e --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Build.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/Lombiq.Analyzers.VisualStudioExtension/License.md b/Lombiq.Analyzers.VisualStudioExtension/License.md new file mode 100644 index 00000000..2e53f494 --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/License.md @@ -0,0 +1,13 @@ +Copyright © 2020, [Lombiq Technologies Ltd.](https://lombiq.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.csproj b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.csproj new file mode 100644 index 00000000..798adbaa --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.csproj @@ -0,0 +1,30 @@ + + + + netstandard2.0 + $(DefaultItemExcludes);.git*; + + License.md + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig new file mode 100644 index 00000000..22316ec2 --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig @@ -0,0 +1,10 @@ +is_global = true +global_level = 20 + +# Code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.NetFx.globalconfig. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. + +# Microsoft.VisualStudio.Threading.Analyzers rules +dotnet_diagnostic.VSTHRD002.severity = warning diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template new file mode 100644 index 00000000..bc6ac779 --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template @@ -0,0 +1,29 @@ + + + + Lombiq.Analyzers.VisualStudioExtension + $version$ + Lombiq .NET Analyzers for Visual Studio Extensions/title> + <authors>Lombiq Technologies</authors> + <license type="file">License.md</license> + <licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl> + <icon>NuGetIcon.png</icon> + <projectUrl>https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.VisualStudioExtension</projectUrl> + <description>Lombiq .NET Analyzers for Visual Studio Extensions: .NET code analyzers and code convention settings for Orchard 1 (https://orchardcore.net/orchardcms) apps. See the project website for detailed documentation.</description> + <copyright>Copyright © 2020, Lombiq Technologies Ltd.</copyright> + <tags>Orchard Lombiq AspNet CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop</tags> + <repository type="git" url="https://github.com/Lombiq/.NET-Analyzers" commit="86d47a37c4d37bb5d8417eae9adfc4680e09fd91" /> + <dependencies> + <!-- Dependencies come here from AnalyzerPackages.props too. --> + <dependency id="Lombiq.Analyzers.NetFx" version="$version$" /> + </dependencies> + </metadata> + <files> + <!-- Workaround for NuGet's validation caused by the presence of these files: + - bin/Release/netstandard2.0/Lombiq.Analyzers.VisualStudioExtension.dll + - obj/Release/netstandard2.0/Lombiq.Analyzers.VisualStudioExtension.dll + The cause is probably that we don't actually do anything in this csproj, it only exists because we need an entry + point for `dotnet pack` (unlike the older `nuget pack` tooling, which worked with just the .nuspec alone).--> + <file src="**" exclude="**\bin\**;**\obj\Release\**" /> + </files> +</package> diff --git a/Lombiq.Analyzers.VisualStudioExtension/NuGetIcon.png b/Lombiq.Analyzers.VisualStudioExtension/NuGetIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..162a00508d8041833604d427216238c1b23b2d47 GIT binary patch literal 4657 zcmV-163*?3P)<h;3K|Lk000e1NJLTq004jh004jp1^@s6!#-il00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T<mc!T}X1N`L?W5ynYGK~#8N?VWp6 zRM)-7fAfR^1VO<@4L+d((ZmN4QVr-eRE)KlR7HE$8i9Z!#C31mdsmw#ZC7JgZ~sVh z^SU>hn=~eB5))%gn$#O#QK7n$s4=L-h!O=vF^a;>Ff(Vme>2-ILt$p`^By>#th3Jf zo%mwTcYcq(e|sM=Ffi!HnCMv&IXStx<YWn2k%P@<gI&8m0;|<Z@2Jnpl_mbVy1JXs z!AA}uco_g~JZ^H+zDka!+S(dF-jsr50g#7}pI!$!?138*1U~rPyLV|UfR$Z!btlAp zcHfZWLvlP%gs?YoM+9bimV$#E5%=)*g2(H<^&8GZA~}l5v4?yKw~-?`aF-J~1du?_ z5r^OJ4;)(J7yNRB;UAKtmWW_P&}2sr0mRdD#GwZP$jE4N>>whD37Ty5YY(6YhyZU* z`lOOYjz@!+Y#0L27(o!^cm}spNxZ;7dL0%+0GcCv2#O=eyx?Vc`gIPV2NX&{?xE+f z^lJ~Gha`}M044qbL+Cjyh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lmttb@V9vx$WDiphmY_G z;4nQy0g3&*ZC(b7ASnSvcm#m2v<$3^nmBPHo(!}{QUZuD3!t{P28Zl6;B{hRBAyJi zM^z7i;6A~PZEdPAe>UhD^*jJVya2wRcHaI2`y*!nzi%Vi1Be=|nlWQ$`b#hU-^;0~ nsrq~UR{!D^QUyrZxEtW_r%bs;&;Z{U00000NkvXXu0mjfi0rae literal 0 HcmV?d00001 diff --git a/Lombiq.Analyzers.VisualStudioExtension/Readme.md b/Lombiq.Analyzers.VisualStudioExtension/Readme.md new file mode 100644 index 00000000..db80acfd --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Readme.md @@ -0,0 +1,6 @@ +# Lombiq .NET Analyzers for Visual Studio Extensions + +## About + +.NET code analyzers and code convention settings for Visual Studio Extension projects. See [the root Readme](../Readme.md) for details on how to use the project. + diff --git a/Lombiq.Analyzers.VisualStudioExtension/build/Lombiq.Analyzers.VisualStudioExtension.props b/Lombiq.Analyzers.VisualStudioExtension/build/Lombiq.Analyzers.VisualStudioExtension.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/build/Lombiq.Analyzers.VisualStudioExtension.props @@ -0,0 +1,7 @@ +<Project> + <PropertyGroup> + <NuGetBuild>true</NuGetBuild> + </PropertyGroup> + + <Import Project="../Build.props"/> +</Project> diff --git a/Lombiq.Analyzers.sln b/Lombiq.Analyzers.sln index 89c02a60..d7a002c7 100644 --- a/Lombiq.Analyzers.sln +++ b/Lombiq.Analyzers.sln @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.NetFx", "L EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.Orchard1", "Lombiq.Analyzers.Orchard1\Lombiq.Analyzers.Orchard1.csproj", "{0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.VisualStudioExtension", "Lombiq.Analyzers.VisualStudioExtension\Lombiq.Analyzers.VisualStudioExtension.csproj", "{85C33788-497A-4223-B266-48B2592A04EA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Debug|Any CPU.Build.0 = Debug|Any CPU {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Release|Any CPU.ActiveCfg = Release|Any CPU {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Release|Any CPU.Build.0 = Release|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 78586c116d88e103e7d21ca1e4d5b5393e7c07cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= <zoltan.lehoczky@lombiq.com> Date: Wed, 11 Oct 2023 22:16:08 +0200 Subject: [PATCH 42/60] Fixing typos --- Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj | 10 +++++----- .../Lombiq.Analyzers.Orchard1.csproj | 12 ++++++------ .../Lombiq.Analyzers.OrchardCore.csproj | 8 ++++---- Lombiq.Analyzers/Lombiq.Analyzers.csproj | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj index a76e3415..16ec8766 100644 --- a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj +++ b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj @@ -3,15 +3,15 @@ <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <DefaultItemExcludes>$(DefaultItemExcludes);.git*;</DefaultItemExcludes> - <!-- This is duplicated with Lombiq.Analyzers.OrchardCore.nuspec.template but is needed for the NuGet publishing workflow not to - throw a warning. See https://github.com/Lombiq/GitHub-Actions/issues/236. --> + <!-- This is duplicated with Lombiq.Analyzers.NetFx.nuspec.template but is needed for the NuGet publishing workflow + not to throw a warning. See https://github.com/Lombiq/GitHub-Actions/issues/236. --> <PackageLicenseFile>License.md</PackageLicenseFile> </PropertyGroup> <!-- This project is built with an externally generated .nuspec file so NuGet-related properties are not needed here. - The package properties can be updated in the Lombiq.Analyzers.OrchardCore.nuspec.template file. The dependencies are created - from the AnalyzerPackages.props file, although if needed further dependencies can be added to - Lombiq.Analyzers.OrchardCore.nuspec.template as well. + The package properties can be updated in the Lombiq.Analyzers.NetFx.nuspec.template file. The dependencies are + created from the AnalyzerPackages.props file, although if needed further dependencies can be added to + Lombiq.Analyzers.NetFx.nuspec.template as well. --> <ItemGroup> diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj index 45a97a36..684422c1 100644 --- a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj @@ -3,15 +3,15 @@ <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <DefaultItemExcludes>$(DefaultItemExcludes);.git*;</DefaultItemExcludes> - <!-- This is duplicated with Lombiq.Analyzers.OrchardCore.nuspec.template but is needed for the NuGet publishing workflow not to - throw a warning. See https://github.com/Lombiq/GitHub-Actions/issues/236. --> + <!-- This is duplicated with Lombiq.Analyzers.Orchard1.nuspec.template but is needed for the NuGet publishing + workflow not to throw a warning. See https://github.com/Lombiq/GitHub-Actions/issues/236. --> <PackageLicenseFile>License.md</PackageLicenseFile> </PropertyGroup> <!-- This project is built with an externally generated .nuspec file so NuGet-related properties are not needed here. - The package properties can be updated in the Lombiq.Analyzers.OrchardCore.nuspec.template file. The dependencies are created - from the AnalyzerPackages.props file, although if needed further dependencies can be added to - Lombiq.Analyzers.OrchardCore.nuspec.template as well. + The package properties can be updated in the Lombiq.Analyzers.Orchard1.nuspec.template file. The dependencies are + created from the AnalyzerPackages.props file, although if needed further dependencies can be added to + Lombiq.Analyzers.Orchard1.nuspec.template as well. --> <ItemGroup> @@ -25,7 +25,7 @@ </ItemGroup> <ItemGroup> - <ProjectReference Include="..\Lombiq.Analyzers\Lombiq.Analyzers.csproj" /> + <ProjectReference Include="..\Lombiq.Analyzers.NetFx\Lombiq.Analyzers.NetFx.csproj" /> </ItemGroup> </Project> diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj index 16cebd4b..9348c934 100644 --- a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj @@ -3,14 +3,14 @@ <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <DefaultItemExcludes>$(DefaultItemExcludes);.git*;</DefaultItemExcludes> - <!-- This is duplicated with Lombiq.Analyzers.OrchardCore.nuspec.template but is needed for the NuGet publishing workflow not to - throw a warning. See https://github.com/Lombiq/GitHub-Actions/issues/236. --> + <!-- This is duplicated with Lombiq.Analyzers.OrchardCore.nuspec.template but is needed for the NuGet publishing + workflow not to throw a warning. See https://github.com/Lombiq/GitHub-Actions/issues/236. --> <PackageLicenseFile>License.md</PackageLicenseFile> </PropertyGroup> <!-- This project is built with an externally generated .nuspec file so NuGet-related properties are not needed here. - The package properties can be updated in the Lombiq.Analyzers.OrchardCore.nuspec.template file. The dependencies are created - from the AnalyzerPackages.props file, although if needed further dependencies can be added to + The package properties can be updated in the Lombiq.Analyzers.OrchardCore.nuspec.template file. The dependencies + are created from the AnalyzerPackages.props file, although if needed further dependencies can be added to Lombiq.Analyzers.OrchardCore.nuspec.template as well. --> diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.csproj b/Lombiq.Analyzers/Lombiq.Analyzers.csproj index c7bf0c7b..a16ea83f 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.csproj +++ b/Lombiq.Analyzers/Lombiq.Analyzers.csproj @@ -16,7 +16,7 @@ <ItemGroup> <None Include="License.md" Pack="true" PackagePath="" /> - <None Include="..\Readme.md" Link="Readme.md" /> + <None Include="Readme.md" Link="Readme.md" /> <None Include="NuGetIcon.png" Pack="true" PackagePath="" /> <None Include="build\**" Pack="true" PackagePath="build\" /> <None Include=".editorconfig" Pack="true" PackagePath="" /> From 12911dc39140a7c9619198e8e4507bde5caf514b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= <zoltan.lehoczky@lombiq.com> Date: Wed, 11 Oct 2023 22:16:18 +0200 Subject: [PATCH 43/60] Adding all remaining NuGet shields --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 88ab771e..e8d409b3 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # Lombiq .NET Analyzers -[![Lombiq.Analyzers NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers?label=Lombiq.Analyzers)](https://www.nuget.org/packages/Lombiq.Analyzers/) [![Lombiq.Analyzers.OrchardCore NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.OrchardCore?label=Lombiq.Analyzers)](https://www.nuget.org/packages/Lombiq.Analyzers.OrchardCore/) +[![Lombiq.Analyzers NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers?label=Lombiq.Analyzers)](https://www.nuget.org/packages/Lombiq.Analyzers/) [![Lombiq.Analyzers.NetFx NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.NetFx?label=Lombiq.Analyzers.NetFx)](https://www.nuget.org/packages/Lombiq.Analyzers.NetFx/) [![Lombiq.Analyzers.OrchardCore NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.OrchardCore?label=Lombiq.Analyzers.OrchardCore)](https://www.nuget.org/packages/Lombiq.Analyzers.OrchardCore/) [![Lombiq.Analyzers.Orchard1 NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.Orchard1?label=Lombiq.Analyzers.Orchard1)](https://www.nuget.org/packages/Lombiq.Analyzers.Orchard1/) [![Lombiq.Analyzers.VisualStudioExtension NuGet](https://img.shields.io/nuget/v/Lombiq.Analyzers.VisualStudioExtension?label=Lombiq.Analyzers.VisualStudioExtension)](https://www.nuget.org/packages/Lombiq.Analyzers.VisualStudioExtension/) ## About From 826733914fcbe8a77a6d60ae8574a8aa23bfcd43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= <zoltan.lehoczky@lombiq.com> Date: Wed, 11 Oct 2023 22:41:39 +0200 Subject: [PATCH 44/60] Fixing XML --- .../Lombiq.Analyzers.VisualStudioExtension.nuspec.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template index bc6ac779..d40e2d04 100644 --- a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template @@ -3,7 +3,7 @@ <metadata> <id>Lombiq.Analyzers.VisualStudioExtension</id> <version>$version$</version> - <title>Lombiq .NET Analyzers for Visual Studio Extensions/title> + <title>Lombiq .NET Analyzers for Visual Studio Extensions Lombiq Technologies License.md https://aka.ms/deprecateLicenseUrl From b89a1ec67c9b836ac537c622d443178d80bba82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 22:43:55 +0200 Subject: [PATCH 45/60] Leftovers --- .../Lombiq.Analyzers.VisualStudioExtension.nuspec.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template index d40e2d04..51b9522d 100644 --- a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template @@ -9,9 +9,9 @@ https://aka.ms/deprecateLicenseUrl NuGetIcon.png https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.VisualStudioExtension - Lombiq .NET Analyzers for Visual Studio Extensions: .NET code analyzers and code convention settings for Orchard 1 (https://orchardcore.net/orchardcms) apps. See the project website for detailed documentation. + Lombiq .NET Analyzers for Visual Studio Extensions: .NET code analyzers and code convention settings for Visual Studio Extensions. See the project website for detailed documentation. Copyright © 2020, Lombiq Technologies Ltd. - Orchard Lombiq AspNet CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + VisualStudioExtension VisualStudio Lombiq AspNet CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop From 3fdce1b8f6de6c620da57f4f48034a8c8eeb23c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 22:49:06 +0200 Subject: [PATCH 46/60] Updating to latest NuGet --- .../IndirectPackageReference/IndirectPackageReference.csproj | 2 +- .../Lombiq.Analyzers.PackageReference.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj index dd63db3e..40eaa977 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/IndirectPackageReference/IndirectPackageReference.csproj @@ -10,7 +10,7 @@ --> - + all diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj index 9251864d..0376d65b 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj @@ -5,7 +5,7 @@ - + all From a5fa3b2568da0dc6cf60acc5b1202a63ad7382d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 22:57:28 +0200 Subject: [PATCH 47/60] Fixing duplicated lines in Readmes --- Lombiq.Analyzers.Orchard1/Readme.md | 1 - Lombiq.Analyzers.VisualStudioExtension/Readme.md | 1 - 2 files changed, 2 deletions(-) diff --git a/Lombiq.Analyzers.Orchard1/Readme.md b/Lombiq.Analyzers.Orchard1/Readme.md index 7428f74f..49e07be9 100644 --- a/Lombiq.Analyzers.Orchard1/Readme.md +++ b/Lombiq.Analyzers.Orchard1/Readme.md @@ -3,4 +3,3 @@ ## About .NET code analyzers and code convention settings for [Orchard 1](https://orchardcore.net/orchardcms) projects. See [the root Readme](../Readme.md) for details on how to use the project. - diff --git a/Lombiq.Analyzers.VisualStudioExtension/Readme.md b/Lombiq.Analyzers.VisualStudioExtension/Readme.md index db80acfd..0ec85362 100644 --- a/Lombiq.Analyzers.VisualStudioExtension/Readme.md +++ b/Lombiq.Analyzers.VisualStudioExtension/Readme.md @@ -3,4 +3,3 @@ ## About .NET code analyzers and code convention settings for Visual Studio Extension projects. See [the root Readme](../Readme.md) for details on how to use the project. - From 19c751c4a70ce3f3ecabd7ef891a775b7cade9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 23:08:10 +0200 Subject: [PATCH 48/60] Removing leftover file --- Lombiq.Analyzers/VisualStudioExtension.Build.props | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 Lombiq.Analyzers/VisualStudioExtension.Build.props diff --git a/Lombiq.Analyzers/VisualStudioExtension.Build.props b/Lombiq.Analyzers/VisualStudioExtension.Build.props deleted file mode 100644 index 6ad41825..00000000 --- a/Lombiq.Analyzers/VisualStudioExtension.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 61061697880b0b2b43c5cf03e1fa0e7325e37b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 23:08:57 +0200 Subject: [PATCH 49/60] Trying out developmentDependency --- Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template | 1 + .../Lombiq.Analyzers.Orchard1.nuspec.template | 1 + .../Lombiq.Analyzers.VisualStudioExtension.nuspec.template | 1 + Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template | 1 + 4 files changed, 4 insertions(+) diff --git a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template index 393781fc..52a9c515 100644 --- a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template +++ b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template @@ -17,6 +17,7 @@ + true + true + true + true - + all diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj index 0376d65b..cc1ccf18 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj @@ -5,7 +5,7 @@ - + all From a213ad075a48dafdfd030117d7440d7cd15ff72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 23:21:45 +0200 Subject: [PATCH 51/60] Docs --- .../Lombiq.Analyzers.NetFx.globalconfig | 2 +- .../Lombiq.Analyzers.Orchard1.globalconfig | 2 +- .../Lombiq.Analyzers.OrchardCore.globalconfig | 2 +- ...alyzers.VisualStudioExtension.globalconfig | 2 +- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 50 ++++++++++++------- Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md | 10 ++-- .../UsingAnalyzersDuringCommandLineBuilds.md | 2 +- .../Docs/UsingAnalyzersDuringDevelopment.md | 6 +-- .../Lombiq.Analyzers.globalconfig | 2 +- 9 files changed, 44 insertions(+), 34 deletions(-) diff --git a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig index 0bb1d45b..d2d434d4 100644 --- a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig +++ b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig @@ -4,7 +4,7 @@ global_level = 10 # General code analysis rules for .NET Framework projects, extending Lombiq.Analyzers.globalconfig. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and -# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. # Microsoft.CodeAnalysis.NetAnalyzers rules dotnet_diagnostic.CA1016.severity = none diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig index ab489fd0..74c575ba 100644 --- a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig @@ -5,7 +5,7 @@ global_level = 20 # Lombiq.Analyzers.OrchardCore.globalconfig. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and -# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. # Microsoft.CodeAnalysis.NetAnalyzers rules dotnet_diagnostic.CA3147.severity = none diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig index 10653d62..a3cd3ca8 100644 --- a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig @@ -4,7 +4,7 @@ global_level = 10 # Code analysis rules for Orchard Core projects, extending Lombiq.Analyzers.globalconfig. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and -# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. # Microsoft.CodeAnalysis.CSharp rules diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig index 22316ec2..f79ff9f7 100644 --- a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig @@ -4,7 +4,7 @@ global_level = 20 # Code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.NetFx.globalconfig. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and -# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. # Microsoft.VisualStudio.Threading.Analyzers rules dotnet_diagnostic.VSTHRD002.severity = warning diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index c850e90f..b7bdfc94 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -12,9 +12,25 @@ Lombiq .NET Analyzers is split into multiple projects/packages so you can select You only need to reference a single project; e.g., even though Orchard Core apps are also .NET apps, you only need to use `Lombiq.Analyzers.OrchardCore` for them. -## How to add the analyzers to your whole repository of SDK-style projects +## How to add the analyzers to SDK-style projects from NuGet + +If you don't want to stay on the cutting-edge version, nor do you intend to contribute to Lombiq .NET Analyzers, you can use one of the NuGet packages. Install the package suitable for your project, as selected above. Check for the latest version number [on NuGet](https://www.nuget.org/packages/Lombiq.Analyzers/). + +```csproj + + all + +``` + +The `all` is necessary to prevent the analyzers "leaking" into other projects that may consume yours. + +You can also add the package to all projects inside a folder at once [from a _Directory.Build.props_ file](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build). + +## How to add the analyzers to SDK-style projects from a Git submodule + +Use this approach if you always want to use the very latest version, or if you'd like to contribute to Lombiq .NET Analyzers. -1. Add to _.gitmodules_ file (we use the _tools_ subfolder for the submodule's folder here but feel free to use something else): +1. Add to the following to the _.gitmodules_ file (we use the _tools_ subfolder for the submodule's folder here but feel free to use something else): ```gitmodules [submodule "Lombiq.Analyzers"] @@ -51,24 +67,20 @@ For at least Visual Studio and JetBrains Rider you don't need any further setup } ``` -## How to add the analyzers to SDK-style projects from NuGet - -If you don't want to stay on the cutting-edge version, nor do you intend to contribute to Lombiq .NET Analyzers, you can use one of the NuGet packages. Install the package suitable for your project, as selected above. Check for the latest version number [on NuGet](https://www.nuget.org/packages/Lombiq.Analyzers/). - -```csproj - - all - -``` +## How to add the analyzers to individual non-SDK-style .NET Framework projects (not solutions) -The `all` is necessary to prevent the analyzers "leaking" into other projects that may consume yours. +The key difference compared to .NET projects is that for non-SDK-style .NET Framework projects, you need to add Lombiq .NET Analyzers to each project. -You can also add the package to all projects inside a folder at once [from a _Directory.Build.props_ file](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build). - -## How to add the analyzers to individual non-SDK-style .NET Framework projects (not solutions) +1. Same as above - add the .NET-Analyzers repository as a Git submodule to your repository or add the NuGet package in the next step. +2. Create a _Directory.Build.props_ file in every project folder you want to target, next to the _.csproj_ file with the following content, either referencing `Lombiq.Analyzers.NetFx` or `Lombiq.Analyzers.Orchard1`: + + ```csproj + + all + + ``` -1. Same as above - add the .NET-Analyzers repository as a submodule to your repository. -2. Create a _Directory.Build.props_ file in every project folder you want to target, next to the _.csproj_ file with the following content, either referencing `Lombiq.Analyzers.NetFx` or `Lombiq.Analyzers.Orchard1` (adjust the relative path as suitable): + Or if you're using a Git submodule (adjust the relative path as suitable): ```xml @@ -78,7 +90,7 @@ You can also add the package to all projects inside a folder at once [from a _Di If you do this for multiple projects, it's recommended to add your own central props file (like _Analyzers.Build.props_) where you do the above and import that in each project instead. -3. The _NetFx.Build.props_ will copy this project's _.editorconfig_ file into every project folder that you've created a _Directory.Build.props_ in, so you might want to gitignore those: +3. _Build.props_ will copy this project's _.editorconfig_ file into every project folder that you've created a _Directory.Build.props_ in, so you might want to gitignore those: ```gitignore .editorconfig @@ -101,7 +113,7 @@ What to do if you're not starting a green-field project but want to add analyzer - .NET Core and .NET 5 or later projects can use this without anything special. - .NET Framework projects: - Projects using the new SDK-style csproj format don't need anything special. You [can convert projects manually](https://docs.microsoft.com/en-us/dotnet/core/porting/#per-project-steps) from the non-SDK-style csproj format or automatically with the [try-convert](https://github.com/dotnet/try-convert) utility. You'll also need to manually remove any leftover _packages.config_ files and adjust _NuGet.config_ files. - - Projects using the legacy, non-SDK-style csproj format should use _NetFx.Build.props_ as described above, but the including project needs to use `PackageReference`s. You can convert your _packages.config_-based project to `PackageReference`s using [this walkthrough](https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference). + - Projects using the legacy, non-SDK-style csproj format should use `Lombiq.Analyzers.NetFx` as described above, but the including project needs to use `PackageReference`s. You can convert your _packages.config_-based project to `PackageReference`s using [this walkthrough](https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference). 4. Now you can add this project to yours as explained above. 5. Introduce analyzers gradually unless it's a small project and you can fix every analyzer violation at once. To do this, only enable a handful of analyzers first (or enable them just for a couple of projects in a given solution), fix the violations, get used to them, then enable more later. See [the docs on configuring analyzers](ConfiguringAnalyzers.md) for how to do disable certain analyzers of the default configuration and thus activating analyzers in your code base gradually. We recommend enabling analyzers and fixing violations in at least three stages: 1. All the simpler rules, i.e. all rules except the ones in the next steps (that means, if you're working with the default configuration, to disable the rules mentioned in the next steps). These are quite straightforward to fix, to an extent can be done even automatically. It's the best if you group warnings by code in the Error List and fix them one by one, committing to the repository after completing each. It's better to batch this work in a way that you fix a particular type of warning for all projects of a solution at once, as opposed to fixing multiple type of warnings for just selected projects. This is because it's more efficient to just repeat the same kind of fix for all projects (can sometimes even be done automatically) in one go instead of revisiting it in multiple iterations. For tips on how to make fixing violations easier see [this page](UsingAnalyzersDuringDevelopment.md). diff --git a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md index 23eb0ab2..7da36459 100644 --- a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md +++ b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md @@ -14,7 +14,7 @@ Place a _Directory.Build.props_ file into the project's folder (or folder with s ``` -This will completely disable code analysis packages. To also disable .NET SDK analysis override them from an _.editorconfig_ file placed into the given project's folder. There you can disable any unwanted rules, like disabling .NET code style analysis completely: +This will completely disable code analysis packages. To also disable .NET SDK analysis override them from an _.globalconfig_ file placed into the given project's folder. There you can disable any unwanted rules, like disabling .NET code style analysis completely: ```editorconfig [*.cs] @@ -35,9 +35,9 @@ If not all the configuration in this project is suitable for your solution then ### Overriding analyzer configuration from a _.globalconfig_ file -1. Create your own _.globalconfig_ file with your own rule configuration, similar to this project's _general.ruleset_ file (see [the official docs on this file format](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig)). +1. Create your own _.globalconfig_ file with your own rule configuration, similar to this project's _.globalconfig_ files (see [the official docs on this file format](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig)). 2. Place the file into the folder under which you want the configuration to apply to all projects. -3. Now every rule you've defined in your _.globalconfig_ file will take precedence over the default ones. For everything else, the default ones will be applied. +3. Now every rule you've configured in your _.globalconfig_ file will take precedence over the default ones. For everything else, the default ones will be applied. Note that if you add your _.globalconfig_ file to the solution you'll get GUI support for it in Visual Studio and you'll be able to configure rules without manually editing the configuration text. @@ -67,7 +67,7 @@ using System.Diagnostics.CodeAnalysis; ### Overriding _.editorconfig_ rules -You can't as easily do the same as with ruleset files with _.editorconfig_ rules. [It's not possible to define explicit inheritance between _.editorconfig_ files](https://github.com/editorconfig/editorconfig/issues/236) so [the only option is to use the folder hierarchy](https://stackoverflow.com/questions/58543855/can-visual-studio-use-an-editorconfig-not-in-the-directory-hierarchy/58556556#58556556): The _Build.props_ file of this project copies the default _.editorconfig_ file into the solution root. If you put your projects below that in the folder hierarchy and use your own _.editorconfig_ there then the latter will take precedence and you can override the default rules. E.g. you can override certain analyzer rules for a whole folder (even a folder within a project) like this: +You can't as easily do the same as with _.globalconfig_ files with _.editorconfig_ rules. [It's not possible to define explicit inheritance between _.editorconfig_ files](https://github.com/editorconfig/editorconfig/issues/236) so [the only option is to use the folder hierarchy](https://stackoverflow.com/questions/58543855/can-visual-studio-use-an-editorconfig-not-in-the-directory-hierarchy/58556556#58556556): The _Build.props_ files of this project copy the default _.editorconfig_ file into the solution root. If you put your projects below that in the folder hierarchy and use your own _.editorconfig_ there then the latter will take precedence and you can override the default rules. E.g. you can override certain analyzer rules for a whole folder (even a folder within a project) like this: ```editor-config [*.{config,csproj,json,props,targets}] @@ -75,8 +75,6 @@ You can't as easily do the same as with ruleset files with _.editorconfig_ rules indent_size = 4 ``` -While eventually all analyzer rules in the .NET ecosystem will live in _.editorconfig_ this is not the case yet. However, you can override _.editorconfig_ rules from a ruleset file: You can open the ruleset file in Visual Studio and under the `Microsoft.CodeAnalysis.CSharp.Features` section you'll also be able to configure each IDE\* rule. - ### Overriding _stylecop.json_ and _SonarLint.xml_ configuration The project includes further configuration for `StyleCop.Analyzers` and `SonarAnalyzer.CSharp` in their own formats. These files are referenced as `` elements in the _props_ files corresponding to .NET Core or later and .NET Framework. From your own _Directory.Build.props_ file you need to recreate the contents of the original _props_ file but reference your custom configuration file instead. diff --git a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md index 52a7255a..4b6a1190 100644 --- a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md +++ b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md @@ -18,7 +18,7 @@ dotnet build MySolution.sln --no-incremental /p:TreatWarningsAsErrors=true ## .NET code style analysis -If you want code style analysis configured in _.editorconfig_ (i.e. IDE\* rules, this is not applicable to the others) to be checked during build too (it's already checked during editing) then you'll need to run the build with `RunAnalyzersDuringBuild=true`. **Don't** enable `EnforceCodeStyleInBuild` as explained in [the docs](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#code-style-analysis) because that always uses the analyzers from the .NET SDK, not the explicitly referenced packages, and violations won't show up (see [this comment](https://github.com/dotnet/roslyn/issues/50785#issuecomment-768606882)). +If you want code style analysis configured in _.globalconfig_ (i.e. IDE\* rules, this is not applicable to the others) to be checked during build too (it's already checked during editing) then you'll need to run the build with `RunAnalyzersDuringBuild=true`. **Don't** enable `EnforceCodeStyleInBuild` as explained in [the docs](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#code-style-analysis) because that always uses the analyzers from the .NET SDK, not the explicitly referenced packages, and violations won't show up (see [this comment](https://github.com/dotnet/roslyn/issues/50785#issuecomment-768606882)). ```ps dotnet build MySolution.sln --no-incremental /p:RunAnalyzersDuringBuild=true diff --git a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md index bcd02127..1b7fa89e 100644 --- a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md +++ b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md @@ -3,12 +3,12 @@ ## Working with analyzers in Visual Studio or another IDE - Output of the analyzers will show up as entries of various levels (i.e. Errors, Warnings, Messages) in the Error List window of Visual Studio for the currently open files (the error codes will link to more info on the violations). You'll also see squiggly lines in the code editor as it is usual for any code issues. -- For a lot of issues you'll be able to use automatic code fixes, or suppress them if they're wrong in the given context from the Visual Studio Quick Actions menu (Ctrl + . by default). The [Productivity Power Tools](https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.ProductivityPowerPack2017) Visual Studio extension can remove and order namespace imports, as well as format the document when saving (just enable its "Format document on save" option). [CodeMaid](https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid) can similarly format whole projects or even the full solution at once. The command-line [`dotnet-format`](https://github.com/dotnet/format) can fix all issues that can be fixed automatically. -- The _Build.props_ (for .NET Framework projects, _NetFx.Build.props_) file disables analyzers during Visual Studio build, not to slow down development; you can enable them by setting `RunAnalyzersDuringBuild` to `true`. After this, they'll show for the whole solution after a rebuild (but not when you build an already built solution, just with a rebuild or a fresh build). +- For a lot of issues you'll be able to use automatic code fixes, or suppress them if they're wrong in the given context from the Visual Studio Quick Actions menu (Ctrl + . by default). The [Productivity Power Tools](https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.ProductivityPowerPack2022) Visual Studio extension can remove and order namespace imports, as well as format the document when saving (just enable its "Format document on save" option). [CodeMaid](https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid) can similarly format whole projects or even the full solution at once. The command-line [`dotnet-format`](https://github.com/dotnet/format) can fix all issues that can be fixed automatically. +- The _Build.props_ files disable analyzers during Visual Studio build, not to slow down development; you can enable them by setting `RunAnalyzersDuringBuild` to `true`. After this, they'll show for the whole solution after a rebuild (but not when you build an already built solution, just with a rebuild or a fresh build). - When working on reducing cognitive complexity to pass the [S3776 rule](https://rules.sonarsource.com/csharp/RSPEC-3776/) you can make use of the [CognitiveComplexity plugin for JetBrains Rider](https://plugins.jetbrains.com/plugin/12024-cognitivecomplexity) or the [ReSharper plugin of the same name](https://plugins.jetbrains.com/plugin/12391-cognitivecomplexity) for Visual Studio. It annotates the individual contributors to the cognitive complexity score so you can quickly identify trouble spots with the least effort. The scoring algorithm is not 100% identical to the one used in Sonar but it's similar enough to greatly speed up the task of refactoring complex methods. - The following VS extensions fit nicely into an analyzer-aided developer workflow: - [Rewrap](https://marketplace.visualstudio.com/items?itemName=stkb.Rewrap-18980) helps you wrap comment text at a character limit you can change in the settings. We recommend this to be set to 120. - - [Editor Guidelines](https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelines) displays the column guidelines defined in our editor config. + - [Editor Guidelines](https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview) displays the column guidelines defined in our editor config. ## Practices on suppressing a rule for a given piece of code diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig index 07068606..6aa96246 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig +++ b/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig @@ -4,7 +4,7 @@ global_level = 0 # General code analysis rules for any .NET and .NET Framework project. # To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and -# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. # Start code style preferences From 45602fe39b6e6d19716146cf23f61496d978c56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 23:28:14 +0200 Subject: [PATCH 52/60] Remove mistakenly added nupkg --- .../publish/Lombiq.Analyzers.NetFx.1.2.3.nupkg | Bin 17438 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Lombiq.Analyzers.NetFx/publish/Lombiq.Analyzers.NetFx.1.2.3.nupkg diff --git a/Lombiq.Analyzers.NetFx/publish/Lombiq.Analyzers.NetFx.1.2.3.nupkg b/Lombiq.Analyzers.NetFx/publish/Lombiq.Analyzers.NetFx.1.2.3.nupkg deleted file mode 100644 index 0cdfe59c9628ec9dd0c419c8de811b0614bb7651..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17438 zcmcJ%WpE|Ck_LE=nVFg0W@cu#+sw?&%*@bcW^S|F%xz|7hPK^pX13RNUQFCOGw((0 z{@8Our6@`HMOBuRlCtuvuQH%uXaE2J3gA;AqdpxHxJv;90Kh;10NBq`eJ4{JX9oJe zj>+HFtw5NN!Y*Ka!xOwYn7o~$zn80iN!E*CKx#~4TfoZ{o#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!nPYCM`B zWT^bQm(^C2q>G@fzQ}s8v3}kp7HbNZE;ta{Zpl$g(7hs72-fqkA-J>i_MY$YB}qth zDixZZcr<})!%i$|CNhy4Qc5!AS{luFC3FM1nQ_J4mo^*OxcpWSTB`B^Qlv}reK}av z+%r^Ci!X0nVmqJC2yUw3z%1_#QTfK!()4x9D#tb+!*qXW+ni#qmG8o%CnbQ5W05x@TvHYwsVP-RA zW9DGtFflb_Wi(^?bP_SMnK5%PvKXwKep1|Nt_Z8LwRtS_ zE2U8ehJOOfsTGN9YWV2X@Oi8iBs+TibnS7eLt0n;w#|ob6m@K^<@kF&P31C7SmmIw z3`>|#m@OUIvdPpJS8IheAf3%|9m;!?1hEBD3T3yDv#5;aPFS1lCW{U73m}4XO<9el zF2o#~J}@GrFE+duJKAfCbP0TmSSMH3Z|0*t!ZQ(5u0~=5Ko?Q@$8y7JGxMvezH>ce z73>=IFW1Ghnz0e3;c>02v)eq+C4QwN4nPJ1*oLwOieO01)J60r2)|Zwy|<=O{<+fN zjR_{x+XvwW-tb_uCbJ1K;I>p%YYzMYSK;AT6!RJH&$L}8>C-^G!KL!6c@&0cqh0hN3AB@_+X!!pF>fg}A|AxB#?1%rK z$m0Km{&(!fzoF}({u7t+pBVp+fc7^A)8_{q{?DEM({TS2>fZ(8{0-$o@XxTEf6D#4 zxP!mtx`_W*6v976|J{!AZ&3o)|2O-~f8zbSz2M(?KR)sPu`~Rq;J=&q{uTuC{u?#^ z>$?sANtyr7lK%}D!1r(M`aiGeFM$7T?fwSH;s5`^_I;HB|0@Ut0QdR#{*1 Date: Wed, 11 Oct 2023 23:31:34 +0200 Subject: [PATCH 53/60] Copy-paste leftover --- Lombiq.Analyzers.Orchard1/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers.Orchard1/Readme.md b/Lombiq.Analyzers.Orchard1/Readme.md index 49e07be9..75d0f66f 100644 --- a/Lombiq.Analyzers.Orchard1/Readme.md +++ b/Lombiq.Analyzers.Orchard1/Readme.md @@ -1,4 +1,4 @@ -# Lombiq .NET Analyzers for Orchard Core +# Lombiq .NET Analyzers for Orchard 1 ## About From 8fec6cb28b9a3a6bc1dfc2305b0b1b196231d45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 23:37:09 +0200 Subject: [PATCH 54/60] Removing leftover --- Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj index 16ec8766..49f2ed9c 100644 --- a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj +++ b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.csproj @@ -32,9 +32,5 @@ - - - - From e724ef1c925fddb46e0245ef655183bff3cf1b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 11 Oct 2023 23:52:50 +0200 Subject: [PATCH 55/60] Removing trailing whitespace --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index b7bdfc94..dfbba2a8 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -73,7 +73,7 @@ The key difference compared to .NET projects is that for non-SDK-style .NET Fram 1. Same as above - add the .NET-Analyzers repository as a Git submodule to your repository or add the NuGet package in the next step. 2. Create a _Directory.Build.props_ file in every project folder you want to target, next to the _.csproj_ file with the following content, either referencing `Lombiq.Analyzers.NetFx` or `Lombiq.Analyzers.Orchard1`: - + ```csproj all From 5f9801a38822053cf12a61216402a722ec51d061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 12 Oct 2023 16:44:38 +0200 Subject: [PATCH 56/60] Docs --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 4 ++-- Readme.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index dfbba2a8..9b874e39 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -5,9 +5,9 @@ Lombiq .NET Analyzers is split into multiple projects/packages so you can select the one most suitable for your application. Depending on your use case, select one of the following: - [`Lombiq.Analyzers`](../Readme.md): General .NET projects. -- [`Lombiq.Analyzers.NetFx`](../../Lombiq.Analyzers.NetFx/Readme.md): .NET Framework projects. +- [`Lombiq.Analyzers.NetFx`](../../Lombiq.Analyzers.NetFx/Readme.md): General .NET Framework projects. - [`Lombiq.Analyzers.OrchardCore`](../../Lombiq.Analyzers.OrchardCore/Readme.md): [Orchard Core](https://orchardcore.net/) projects. -- [`Lombiq.Analyzers.Orchard1`](../../Lombiq.Analyzers.Orchard1/Readme.md): Orchard 1 projects. +- [`Lombiq.Analyzers.Orchard1`](../../Lombiq.Analyzers.Orchard1/Readme.md): [Orchard 1](https://orchardcore.net/orchardcms) projects. - [`Lombiq.Analyzers.VisualStudioExtension`](../../Lombiq.Analyzers.VisualStudioExtension/Readme.md): Visual Studio extension projects. You only need to reference a single project; e.g., even though Orchard Core apps are also .NET apps, you only need to use `Lombiq.Analyzers.OrchardCore` for them. diff --git a/Readme.md b/Readme.md index e8d409b3..b2f351b9 100644 --- a/Readme.md +++ b/Readme.md @@ -4,7 +4,7 @@ ## About -.NET code analyzers and code convention settings for [Lombiq](https://lombiq.com) projects, predominantly for [Orchard Core](https://orchardcore.net/) apps but also any .NET apps. We use these to enforce common standards across all our .NET projects, including e.g. all of our [open-source Orchard Core extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions). If you contribute to our open-source projects while using that solution you'll be guided by these rules, too. You can check out a demo video of the project [here](https://www.youtube.com/watch?v=dtbGRi3Cezs), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU). +.NET code analyzers and code convention settings for [Lombiq](https://lombiq.com) projects, for [Orchard Core](https://orchardcore.net/) and any other .NET and .NET Framework apps. We use these to enforce common standards across all our .NET projects, including e.g. all of our [open-source Orchard Core extensions](https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions). If you contribute to our open-source projects while using that solution you'll be guided by these rules, too. You can check out a demo video of the project [here](https://www.youtube.com/watch?v=dtbGRi3Cezs), and the Orchard Harvest 2023 conference talk about automated QA in Orchard Core [here](https://youtu.be/CHdhwD2NHBU). There is also support for non-SDK-style .NET Framework projects, as long as they use `PackageReference` for their dependencies (in contrast to _packages.config_). From e59fc93871c4ee28f942d814ee15fff2b65dc079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 16 Oct 2023 15:35:07 +0200 Subject: [PATCH 57/60] Docs wording Co-authored-by: Benedek Farkas --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index 9b874e39..7643087c 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -14,7 +14,7 @@ You only need to reference a single project; e.g., even though Orchard Core apps ## How to add the analyzers to SDK-style projects from NuGet -If you don't want to stay on the cutting-edge version, nor do you intend to contribute to Lombiq .NET Analyzers, you can use one of the NuGet packages. Install the package suitable for your project, as selected above. Check for the latest version number [on NuGet](https://www.nuget.org/packages/Lombiq.Analyzers/). +If you don't want to stay on the cutting-edge version, nor do you intend to contribute to Lombiq .NET Analyzers, you can use one of the NuGet packages. Install the package suitable for your project, as described above. Check for the latest version number [on NuGet](https://www.nuget.org/packages/Lombiq.Analyzers/). ```csproj From 31286b50bf964c64261130f7d89d8eaeeec55b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 16 Oct 2023 15:38:24 +0200 Subject: [PATCH 58/60] Clarifying .NET Framework docs --- Lombiq.Analyzers/Docs/AddingAnalyzers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Analyzers/Docs/AddingAnalyzers.md b/Lombiq.Analyzers/Docs/AddingAnalyzers.md index 7643087c..29368d7c 100644 --- a/Lombiq.Analyzers/Docs/AddingAnalyzers.md +++ b/Lombiq.Analyzers/Docs/AddingAnalyzers.md @@ -72,7 +72,7 @@ For at least Visual Studio and JetBrains Rider you don't need any further setup The key difference compared to .NET projects is that for non-SDK-style .NET Framework projects, you need to add Lombiq .NET Analyzers to each project. 1. Same as above - add the .NET-Analyzers repository as a Git submodule to your repository or add the NuGet package in the next step. -2. Create a _Directory.Build.props_ file in every project folder you want to target, next to the _.csproj_ file with the following content, either referencing `Lombiq.Analyzers.NetFx` or `Lombiq.Analyzers.Orchard1`: +2. Create a _Directory.Build.props_ file in a common root folder of your projects, or in every project folder you want to target, next to the _.csproj_ file with the following content, either referencing `Lombiq.Analyzers.NetFx` or `Lombiq.Analyzers.Orchard1`: ```csproj From 56e106733c13248e12c24d6d7a925d21a661417a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 16 Oct 2023 15:39:05 +0200 Subject: [PATCH 59/60] Removing leftover config file --- ...Lombiq.Analyzers.VisualStudioExtension.globalconfig | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig deleted file mode 100644 index 22316ec2..00000000 --- a/Lombiq.Analyzers/Lombiq.Analyzers.VisualStudioExtension.globalconfig +++ /dev/null @@ -1,10 +0,0 @@ -is_global = true -global_level = 20 - -# Code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.NetFx.globalconfig. - -# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and -# rename it to .editorconfig. See https://github.com/dotnet/roslyn/issues/70326. - -# Microsoft.VisualStudio.Threading.Analyzers rules -dotnet_diagnostic.VSTHRD002.severity = warning From 9f7729bb189b10d564046e4667c54ce311545c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 16 Oct 2023 15:53:24 +0200 Subject: [PATCH 60/60] Clarifying placing rules --- Readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.md b/Readme.md index b2f351b9..39761b1d 100644 --- a/Readme.md +++ b/Readme.md @@ -75,4 +75,5 @@ When adding a new analyzer package, do the following: - Go through all rules in the package and decide one by one whether we need them. - Check for rules that are already covered by some other analyzer and disable duplicates. - All rules that we need should be surfaced as Warnings. This allows to only break the build on analyzer violations when we need it, i.e. during CI builds but not during development. + - Add rule configuration to the _.globalconfig_ file of the relevant project, depending on which kind of applications they're applicable to. Editor-only configuration should be in _.editorconfig_ files. - Test it on multiple significant solutions. Using the [Hastlayer SDK](https://github.com/Lombiq/Hastlayer-SDK) is a good example as it's a large C# solution.