Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry pick "Enabled logging analyzer on new repo" #5322

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
82a5b7e
Delete IDE dispose analyzer rules
xtqqczze Jul 19, 2021
af5cc6f
Remove dead code in CA1069 analyzer (#5253)
RikkiGibson Jul 19, 2021
8ca2a79
Merge pull request #5255 from xtqqczze/patch-1
mavasani Jul 20, 2021
0b0fd2c
Initial add of richnav indexing
brianaeng Jul 20, 2021
ef83248
Update yml spacing
brianaeng Jul 20, 2021
dd83d4b
Remove unauthorized settings
brianaeng Jul 20, 2021
a059cd9
Update pool
brianaeng Jul 20, 2021
0296b4a
Remove some empty statements
Evangelink Jul 22, 2021
39ca864
Attempt to fix test step in build pipeline
brianaeng Jul 22, 2021
4ad3a61
Add richnav nuget source
brianaeng Jul 22, 2021
c0fbdbf
RichNav run worked in main yml -- removing from there and copying it …
brianaeng Jul 22, 2021
2ef6f11
Remove added whitespace
brianaeng Jul 22, 2021
50e3c65
Remove unused vars, rename displayName for clarity
brianaeng Jul 22, 2021
2945bf8
Merge pull request #5278 from Evangelink/empty-statements
sharwell Jul 23, 2021
75d0251
Merge pull request #5267 from brianaeng/breng/addRichNav
jmarolf Jul 25, 2021
19af447
Merge pull request #5258 from dotnet/merges/main-to-release/6.0.1xx
dotnet-bot Jul 25, 2021
d36599d
Fix TODOs and update unit tests with diagnostics (#5287)
Jul 27, 2021
12a3544
Add Logging Analyzer
maryamariyan Jul 15, 2021
6c5e4ad
Convert to IOperation analysis
maryamariyan Jul 15, 2021
a45c883
Updated tests based on refactor
maryamariyan Jul 16, 2021
3892a17
minor code cleanup
maryamariyan Jul 16, 2021
e86185d
PR feedback
maryamariyan Jul 16, 2021
3479c9f
Use CreateDiagnostic extension method
maryamariyan Jul 16, 2021
c9d0820
update auto generated files
maryamariyan Jul 19, 2021
2b3cc77
Fix "Run markdownlint" error
maryamariyan Jul 19, 2021
ebed92d
isPortedFxCopRule set false by default
maryamariyan Jul 19, 2021
6dba133
isReportedAtCompilationEnd set to false
maryamariyan Jul 20, 2021
2e85d6d
Rename test class to match file name
sharwell Jul 22, 2021
fbb89d5
Update INameOfOperation handling to use correct constant value
sharwell Jul 22, 2021
41a7fd9
Update IOperation to understand params arguments
sharwell Jul 22, 2021
d7e7ee3
move analyzer from csharp to core
maryamariyan Jul 27, 2021
63bf4c4
Apply API review feedback.
maryamariyan Jul 27, 2021
7c668b7
narrow down scope of 4th diagnostic to LogTrace and friends
maryamariyan Jul 27, 2021
88ed19a
updating messages to become a bit more clear
maryamariyan Jul 28, 2021
0e517e5
Apply nit feedback
maryamariyan Jul 28, 2021
24f5bfb
nit feedback
maryamariyan Jul 28, 2021
87443d4
if to else if
maryamariyan Jul 28, 2021
3363fbe
Merge pull request #5294 from dotnet/merges/main-to-release/6.0.1xx
dotnet-bot Jul 28, 2021
0c84b59
rename: named hole -> named placeholder
maryamariyan Jul 28, 2021
cf7cc42
fix paranthesis issue
maryamariyan Jul 28, 2021
2721158
Merge remote-tracking branch 'upstream/release/6.0.1xx-preview7' into…
jmarolf Jul 28, 2021
c19648e
do not update the label
jmarolf Jul 28, 2021
7445fb3
Merge pull request #5244 from maryamariyan/logging-az
jmarolf Jul 28, 2021
92cc133
Merge pull request #5293 from dotnet/merges/release/6.0.1xx-preview7-…
dotnet-bot Jul 28, 2021
fa1323a
keep preview7
jmarolf Jul 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion

# Dispose rules (CA2000 and CA2213) ported to IDE analyzers. We already execute the CA rules on the repo, so disable the IDE ones.
dotnet_diagnostic.IDE0067.severity = none
dotnet_diagnostic.IDE0068.severity = none
dotnet_diagnostic.IDE0069.severity = none

### CSharp code style settings ###
[*.cs]

Expand Down
2 changes: 2 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<!-- Used for Rich Navigation indexing task -->
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
28 changes: 28 additions & 0 deletions azure-pipelines-richnav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Branches that trigger a build on commit
trigger:
- main
- release/*

stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableRichCodeNavigation: true
richCodeNavigationEnvironment: "production"
richCodeNavigationLanguage: "csharp"
jobs:
- job: Debug_Build
pool:
name: NetCorePublic-Pool
queue: BuildPool.Windows.10.Amd64.VS2019.Pre.Open
variables:
- name: _BuildConfig
value: Debug
steps:
- checkout: self
clean: true
- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
displayName: Build and Index
5 changes: 5 additions & 0 deletions src/NetAnalyzers/Core/AnalyzerReleases.Unshipped.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Rule ID | Category | Severity | Notes
--------|----------|----------|-------
CA1418 | Interoperability | Warning | UseValidPlatformString, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1418)
CA1419 | Interoperability | Info | ProvidePublicParameterlessSafeHandleConstructor, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1419)
CA1727 | Naming | Hidden | LoggerMessageDefineAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1727)
CA1839 | Performance | Info | UseEnvironmentMembers, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1839)
CA1840 | Performance | Info | UseEnvironmentMembers, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1840)
CA1841 | Performance | Info | PreferDictionaryContainsMethods, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1841)
Expand All @@ -15,9 +16,13 @@ CA1844 | Performance | Info | ProvideStreamMemoryBasedAsyncOverrides, [Documenta
CA1845 | Performance | Info | UseSpanBasedStringConcat, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1845)
CA1846 | Performance | Info | PreferAsSpanOverSubstring, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1846)
CA1847 | Performance | Info | UseStringContainsCharOverloadWithSingleCharactersAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1847)
CA1848 | Performance | Hidden | LoggerMessageDefineAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1848)
CA2017 | Reliability | Warning | LoggerMessageDefineAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2017)
CA2250 | Usage | Info | UseCancellationTokenThrowIfCancellationRequested, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2250)
CA2251 | Usage | Hidden | UseStringEqualsOverStringCompare, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2251)
CA2252 | Usage | Info | DetectPreviewFeatureAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2252)
CA2253 | Usage | Info | LoggerMessageDefineAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2253)
CA2254 | Usage | Info | LoggerMessageDefineAnalyzer, [Documentation](https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2254)

### Removed Rules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ void visitInitializerValue(IOperation operation)

void endVisitEnumSymbol(SymbolAnalysisContext context)
{
var enumSymbol = (INamedTypeSymbol)context.Symbol;
// visit any duplicates which didn't have an initializer
foreach (var field in duplicates)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,51 @@
<data name="AbstractTypesShouldNotHaveConstructorsMessage" xml:space="preserve">
<value>Abstract type '{0}' should not have public constructors</value>
</data>
<data name="LoggerMessageDiagnosticNumericsInFormatStringTitle" xml:space="preserve">
<value>Named placeholders should not be numeric values</value>
</data>
<data name="LoggerMessageDiagnosticNumericsInFormatStringMessage" xml:space="preserve">
<value>Named placeholders in the logging message template should not be comprised of only numeric characters</value>
</data>
<data name="LoggerMessageDiagnosticNumericsInFormatStringDescription" xml:space="preserve">
<value>Named placeholders in the logging message template should not be comprised of only numeric characters.</value>
</data>
<data name="LoggerMessageDiagnosticFormatParameterCountMismatchTitle" xml:space="preserve">
<value>Parameter count mismatch</value>
</data>
<data name="LoggerMessageDiagnosticFormatParameterCountMismatchMessage" xml:space="preserve">
<value>Number of parameters supplied in the logging message template do not match the number of named placeholders</value>
</data>
<data name="LoggerMessageDiagnosticFormatParameterCountMismatchDescription" xml:space="preserve">
<value>Number of parameters supplied in the logging message template do not match the number of named placeholders.</value>
</data>
<data name="LoggerMessageDiagnosticUseCompiledLogMessagesTitle" xml:space="preserve">
<value>Use the LoggerMessage delegates</value>
</data>
<data name="LoggerMessageDiagnosticUseCompiledLogMessagesMessage" xml:space="preserve">
<value>For improved performance, use the LoggerMessage delegates instead of calling '{0}'</value>
</data>
<data name="LoggerMessageDiagnosticUseCompiledLogMessagesDescription" xml:space="preserve">
<value>For improved performance, use the LoggerMessage delegates.</value>
</data>
<data name="LoggerMessageDiagnosticConcatenationInFormatStringTitle" xml:space="preserve">
<value>Template should be a static expression</value>
</data>
<data name="LoggerMessageDiagnosticConcatenationInFormatStringMessage" xml:space="preserve">
<value>The logging message template should not vary between calls to '{0}'</value>
</data>
<data name="LoggerMessageDiagnosticConcatenationInFormatStringDescription" xml:space="preserve">
<value>The logging message template should not vary between calls.</value>
</data>
<data name="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensTitle" xml:space="preserve">
<value>Use PascalCase for named placeholders</value>
</data>
<data name="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensMessage" xml:space="preserve">
<value>Use PascalCase for named placeholders in the logging message template</value>
</data>
<data name="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensDescription" xml:space="preserve">
<value>Use PascalCase for named placeholders in the logging message template.</value>
</data>
<data name="MarkAssembliesWithClsCompliantTitle" xml:space="preserve">
<value>Mark assemblies with CLSCompliant</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,81 @@
<target state="translated">Odeberte finalizační metodu z typu {0}, přepište Dispose(bool disposing) a vložte finalizační logiku do cesty kódu, kde je disposing hodnoty false. V opačném případě by to mohlo vést k duplicitním voláním Dispose, protože základní typ {1} také poskytuje finalizační metodu.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticConcatenationInFormatStringDescription">
<source>The logging message template should not vary between calls.</source>
<target state="new">The logging message template should not vary between calls.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticConcatenationInFormatStringMessage">
<source>The logging message template should not vary between calls to '{0}'</source>
<target state="new">The logging message template should not vary between calls to '{0}'</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticConcatenationInFormatStringTitle">
<source>Template should be a static expression</source>
<target state="new">Template should be a static expression</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticFormatParameterCountMismatchDescription">
<source>Number of parameters supplied in the logging message template do not match the number of named placeholders.</source>
<target state="new">Number of parameters supplied in the logging message template do not match the number of named placeholders.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticFormatParameterCountMismatchMessage">
<source>Number of parameters supplied in the logging message template do not match the number of named placeholders</source>
<target state="new">Number of parameters supplied in the logging message template do not match the number of named placeholders</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticFormatParameterCountMismatchTitle">
<source>Parameter count mismatch</source>
<target state="new">Parameter count mismatch</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticNumericsInFormatStringDescription">
<source>Named placeholders in the logging message template should not be comprised of only numeric characters.</source>
<target state="new">Named placeholders in the logging message template should not be comprised of only numeric characters.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticNumericsInFormatStringMessage">
<source>Named placeholders in the logging message template should not be comprised of only numeric characters</source>
<target state="new">Named placeholders in the logging message template should not be comprised of only numeric characters</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticNumericsInFormatStringTitle">
<source>Named placeholders should not be numeric values</source>
<target state="new">Named placeholders should not be numeric values</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUseCompiledLogMessagesDescription">
<source>For improved performance, use the LoggerMessage delegates.</source>
<target state="new">For improved performance, use the LoggerMessage delegates.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUseCompiledLogMessagesMessage">
<source>For improved performance, use the LoggerMessage delegates instead of calling '{0}'</source>
<target state="new">For improved performance, use the LoggerMessage delegates instead of calling '{0}'</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUseCompiledLogMessagesTitle">
<source>Use the LoggerMessage delegates</source>
<target state="new">Use the LoggerMessage delegates</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensDescription">
<source>Use PascalCase for named placeholders in the logging message template.</source>
<target state="new">Use PascalCase for named placeholders in the logging message template.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensMessage">
<source>Use PascalCase for named placeholders in the logging message template</source>
<target state="new">Use PascalCase for named placeholders in the logging message template</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensTitle">
<source>Use PascalCase for named placeholders</source>
<target state="new">Use PascalCase for named placeholders</target>
<note />
</trans-unit>
<trans-unit id="MarkAttributesWithAttributeUsageCodeFix">
<source>Apply 'AttributeUsageAttribute'</source>
<target state="translated">Použít AttributeUsageAttribute</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,81 @@
<target state="translated">Entfernen Sie den Finalizer vom Typ "{0}", setzen Sie "Dispose(bool disposing)" außer Kraft, und platzieren Sie die Finalisierungslogik im Codepfad, wenn "disposing" FALSE lautet. Andernfalls kann es zu doppelten Dispose-Aufrufen kommen, weil der Basistyp "{1}" ebenfalls einen Finalizer bereitstellt.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticConcatenationInFormatStringDescription">
<source>The logging message template should not vary between calls.</source>
<target state="new">The logging message template should not vary between calls.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticConcatenationInFormatStringMessage">
<source>The logging message template should not vary between calls to '{0}'</source>
<target state="new">The logging message template should not vary between calls to '{0}'</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticConcatenationInFormatStringTitle">
<source>Template should be a static expression</source>
<target state="new">Template should be a static expression</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticFormatParameterCountMismatchDescription">
<source>Number of parameters supplied in the logging message template do not match the number of named placeholders.</source>
<target state="new">Number of parameters supplied in the logging message template do not match the number of named placeholders.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticFormatParameterCountMismatchMessage">
<source>Number of parameters supplied in the logging message template do not match the number of named placeholders</source>
<target state="new">Number of parameters supplied in the logging message template do not match the number of named placeholders</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticFormatParameterCountMismatchTitle">
<source>Parameter count mismatch</source>
<target state="new">Parameter count mismatch</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticNumericsInFormatStringDescription">
<source>Named placeholders in the logging message template should not be comprised of only numeric characters.</source>
<target state="new">Named placeholders in the logging message template should not be comprised of only numeric characters.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticNumericsInFormatStringMessage">
<source>Named placeholders in the logging message template should not be comprised of only numeric characters</source>
<target state="new">Named placeholders in the logging message template should not be comprised of only numeric characters</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticNumericsInFormatStringTitle">
<source>Named placeholders should not be numeric values</source>
<target state="new">Named placeholders should not be numeric values</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUseCompiledLogMessagesDescription">
<source>For improved performance, use the LoggerMessage delegates.</source>
<target state="new">For improved performance, use the LoggerMessage delegates.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUseCompiledLogMessagesMessage">
<source>For improved performance, use the LoggerMessage delegates instead of calling '{0}'</source>
<target state="new">For improved performance, use the LoggerMessage delegates instead of calling '{0}'</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUseCompiledLogMessagesTitle">
<source>Use the LoggerMessage delegates</source>
<target state="new">Use the LoggerMessage delegates</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensDescription">
<source>Use PascalCase for named placeholders in the logging message template.</source>
<target state="new">Use PascalCase for named placeholders in the logging message template.</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensMessage">
<source>Use PascalCase for named placeholders in the logging message template</source>
<target state="new">Use PascalCase for named placeholders in the logging message template</target>
<note />
</trans-unit>
<trans-unit id="LoggerMessageDiagnosticUsePascalCasedLogMessageTokensTitle">
<source>Use PascalCase for named placeholders</source>
<target state="new">Use PascalCase for named placeholders</target>
<note />
</trans-unit>
<trans-unit id="MarkAttributesWithAttributeUsageCodeFix">
<source>Apply 'AttributeUsageAttribute'</source>
<target state="translated">"AttributeUsageAttribute" anwenden</target>
Expand Down
Loading