diff --git a/.editorconfig b/.editorconfig index 666d479ee..e7d7b1352 100644 --- a/.editorconfig +++ b/.editorconfig @@ -38,12 +38,14 @@ insert_final_newline = true dotnet_separate_import_directive_groups = false dotnet_sort_system_directives_first = true file_header_template = unset +dotnet_diagnostic.SA1633.severity = silent # A C# code file is missing a standard file header. https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1633.md # this. and Me. preferences dotnet_style_qualification_for_event = false:silent dotnet_style_qualification_for_field = false:silent dotnet_style_qualification_for_method = false:silent dotnet_style_qualification_for_property = false:silent +dotnet_diagnostic.SA1101.severity = silent # SA1101: Prefix local calls with this # Language keywords vs BCL types preferences dotnet_style_predefined_type_for_locals_parameters_members = true:silent @@ -84,6 +86,10 @@ dotnet_code_quality_unused_parameters = all:suggestion # Suppression preferences dotnet_remove_unnecessary_suppression_exclusions = none +# XMLDocs preferences +# SA1600: Elements should be documented. We disable this it requires xmldocs for _all_ members. CS1591 already covers documenting public members. +dotnet_diagnostic.SA1600.severity = silent + #### C# Coding Conventions #### [*.cs] diff --git a/Source/Moq.Analyzers.Test/AsAcceptOnlyInterfaceAnalyzerTests.cs b/Source/Moq.Analyzers.Test/AsAcceptOnlyInterfaceAnalyzerTests.cs index fd7f54edd..870c03832 100644 --- a/Source/Moq.Analyzers.Test/AsAcceptOnlyInterfaceAnalyzerTests.cs +++ b/Source/Moq.Analyzers.Test/AsAcceptOnlyInterfaceAnalyzerTests.cs @@ -9,11 +9,9 @@ public static IEnumerable TestData() { return new object[][] { - // TODO: .As and .As feels redundant ["""new Mock().As<{|Moq1300:BaseSampleClass|}>();"""], ["""new Mock().As<{|Moq1300:SampleClass|}>();"""], ["""new Mock().As();"""], - // TODO: Testing with .Setup() and .Returns() seems unnecessary. ["""new Mock().As().Setup(x => x.Calculate(It.IsAny(), It.IsAny())).Returns(10);"""], }.WithNamespaces().WithReferenceAssemblyGroups(); } diff --git a/Source/Moq.Analyzers.Test/GlobalSuppressions.cs b/Source/Moq.Analyzers.Test/GlobalSuppressions.cs index 47a706e8e..15348aa5c 100644 --- a/Source/Moq.Analyzers.Test/GlobalSuppressions.cs +++ b/Source/Moq.Analyzers.Test/GlobalSuppressions.cs @@ -3,8 +3,4 @@ // Project-level suppressions either have no target or are given // a specific target and scoped to a namespace, type, member, etc. -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1633:File must have header", Justification = "Not required")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1652:Enable XML documentation output", Justification = "Not required")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces must not be omitted", Justification = "Not required")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Not required")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "Not required")] diff --git a/Source/Moq.Analyzers/ConstructorArgumentsShouldMatchAnalyzer.cs b/Source/Moq.Analyzers/ConstructorArgumentsShouldMatchAnalyzer.cs index 2f57141ff..b08d5c99d 100644 --- a/Source/Moq.Analyzers/ConstructorArgumentsShouldMatchAnalyzer.cs +++ b/Source/Moq.Analyzers/ConstructorArgumentsShouldMatchAnalyzer.cs @@ -27,6 +27,7 @@ public override ImmutableArray SupportedDiagnostics get { return ImmutableArray.Create(Rule); } } + /// public override void Initialize(AnalysisContext context) { context.EnableConcurrentExecution(); diff --git a/Source/Moq.Analyzers/GlobalSuppressions.cs b/Source/Moq.Analyzers/GlobalSuppressions.cs index 47a706e8e..15348aa5c 100644 --- a/Source/Moq.Analyzers/GlobalSuppressions.cs +++ b/Source/Moq.Analyzers/GlobalSuppressions.cs @@ -3,8 +3,4 @@ // Project-level suppressions either have no target or are given // a specific target and scoped to a namespace, type, member, etc. -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1633:File must have header", Justification = "Not required")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1652:Enable XML documentation output", Justification = "Not required")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces must not be omitted", Justification = "Not required")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Not required")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "Not required")]