You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Roslyn analyzers to detect incorrect usage of BenchmarkDotNet (#2837)
* Add Roslyn analyzers to detect incorrect usage of BenchmarkDotNet
* Unify C# language version
* Remove Analyzers package projects
* Revert BenchmarkDotNet.Disassembler changes
* Reference Analyzers project from Annotations
* Move Benchmark.Analyzers and Benchmark.Analyzers.Tests to correct directories
* Remove accidentally added package Microsoft.CodeAnalysis.NetAnalyzers from BenchmarkDotNet.Annotations
* * Benchmark classes annotated with a [GenericTypeArguments] attribute must be non-abstract and generic
* Benchmark classes are allowed to be generic if they are either abstract or annotated with at least one [GenericTypeArguments] attribute
* Assume that a class can be annotated with more than one [GenericTypeArguments] attribute
* * Change diagnostic ID increment ordering
* Add a rule that the benchmark class referenced in the type argument of the BenchmarkRunner.Run method cannot be abstract
* When determining whether a class has any benchmark methods, iterate through its ancestors
* Move "Benchmark class cannot be sealed" to Run analyzer
* Move "Benchmark class must be public" to Run analyzer
* Support analyzing overload of BenchmarkRunner.Run that takes a Type parameter created by using a typeof expression
* Remove requirement that a class must have at least one method annotated with the Benchmark attribute when analyzing GenericTypeArguments attribute rules
* * Integer attribute values that fit within target type range should not trigger mismatching type diagnostics
* Test all valid attribute value types when performing type matching
* Use a dummy syntax tree to test whether types are implicitly convertible
* Move "Generic class must be abstract or annotated with a [GenericTypeArgumentsAttribute]" to Run analyzer and remove abstract modifier requirement
* Add support to analyze implicit conversion from an array to a Span of said array for [Arguments] attribute values
* Add support to analyze implicit conversion when using constant values for [Params] and [Arguments] attribute values
* * Add support to analyze a boolean constant value for the Baseline property on BenchmarkAttribute
* Split logic for baseline method analyzer into two rules, also verifying whether they're unique per category
* Add test to OnlyOneMethodCanBeBaselinePerCategory rule verifying that it works correctly with invalid string values
* Disable warnings for "Missing XML comment for publicly visible type or member" (CS1591)
* Correct resource strings for OnlyOneMethodCanBeBaselinePerCategory rule
* Build error fixes
* Add analyzer projects to main sln.
Run analyzer tests in CI.
Fix compile errors.
Ensure analyzers run against test projects.
* Revert annotations csproj.
Add analyzers to samples.
* * Change severity level of "UnnecessarySingleValuePassedToAttribute" rule from warning to information
* Move diagnostic "MethodWithoutAttributeMustHaveNoParameters" to its own analyzer and also take [ArgumentsSource] attribute into consideration
* Suppress analyzer errors for incorrect BenchmarkDotNet usages in tests
* Adjust wording of "ClassWithGenericTypeArgumentsAttributeMustBeGenericRule" diagnostic and move trigger location to the attribute level
* Revert suppressing of BDN1401 in ArgumentsTests.cs
* Revert suppressing of BDN1401 in FullNameProviderTests.cs, PriorityTests.cs and TypeFilterTests.cs
* Fix Directory.build.props included in autogenerated projects.
* Add message to failing CI test.
* Revert sdk update.
* Suppress warning.
* Skip failing test
* Adjust wording of "ClassWithGenericTypeArgumentsAttributeMustBeNonAbstract" diagnostic and move trigger location to the attribute level
* Add diagnostics for unintendedly passing a single null value to the [Arguments] or [Params] attribute
* Revert commit d760312
* Formatting
---------
Co-authored-by: Tim Cassell <cassell.timothy@gmail.com>
0 commit comments