Conversation
MattKotsenas
left a comment
There was a problem hiding this comment.
Is there a way so that the rules the Codacity static analysis reports are driven by our .editorconfig? It's currently showing errors for stuff we've intentionally disabled (at least to date) like CLS attributes and copyright headers.
The point isn't that those rules are good or bad, it's that we've introduced multiple, conflicting sources-of-truth.
# Conflicts: # .editorconfig # Source/Moq.Analyzers/CallbackSignatureShouldMatchMockedMethodAnalyzer.cs # Source/Moq.Analyzers/ConstructorArgumentsShouldMatchAnalyzer.cs # Source/Moq.Analyzers/Helpers.cs # Source/Moq.Analyzers/NoConstructorArgumentsForInterfaceMockAnalyzer.cs
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences🚀 Don’t miss a bit, follow what’s new on Codacy. Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
|
@MattKotsenas we can turn off Codacy when we get reporting of coverage up as something we can gate on. We can also check in a config file to keep the integration sane. I disabled the Sonar analyzer, so I'm really just interested in code coverage and some obvious linting things in YAML, PowerShell, and JSON files. The recommendation from Codacy is to check in the configuration for the tools used themselves and it'll pick them up. |
#91 intended to enable warnings as errors in CI. However, `$(ContinuousIntegrationBuild)` is set by `DotNet.ReproducibleBuilds`, and that package's .props file is imported _after_ our own Directory.Build.props. As a result, the properties were evaluated before they were set. This change moves them into the .targets file as "computed properties" in order for them to pick up the configuration from .props files. This aligns with the [documented guidance](https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022#choose-between-adding-properties-to-a-props-or-targets-file) "Set dependent properties in .targets files, because they pick up customizations from individual projects.". I've also filed dotnet/reproducible-builds#45 to see if we can make the reproducible-builds package more intuitive. Lastly, this cleans up existing warnings: - Fixes whitespace issues - Suppresses StyleCop warnings about documenting public members in tests, which already had the built-in rules suppressed - Reorders static members to be above instance members - Adds a single suppression for a long method to keep the change small
.editorconfigto set policy on some duplicate warnings for TODO. Borrowed from Add more analyzers and bump Meziantou.Analzer to latest version #89 to make merging easier<NoWarn>fromMoq.Analyzers.csproj<TreatWarningsAsErrors>andMSBuildTreatWarningsAsErrorselements toCodeAnalysis.propstruewhen MSBuild property$(ContinuousIntegrationBuild)istruefromDotNet.ReproducibleBuildspackage