-
Notifications
You must be signed in to change notification settings - Fork 5
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
Enable additional static analysis analyzers #27
Comments
As pointed out in a PR comment here: #19 (comment) |
## Description Adds a new static analyzer in the form of [IDisposableAnalyzers](https://www.nuget.org/packages/IDisposableAnalyzers/). The new analyzer immediately caught a violation where the project was not properly disposing a system-level resource, so this change also cleans that up. This is part of #27. ## Changes * Add IDisposableAnalyzers to the common packages imported by all projects * Fix violations of the new analyzer ## Verification * Build passes locally
Maybe investigate others here: https://github.com/dotnet/roslyn-analyzers. I know I've also seen things like IDE0044 being highlighted in vscode, it'd be great to surface some of those in the build. |
## Description This is the first of several changes to incrementally enable FxCopAnalyzers in this repository. FxCopAnalyzers allows us to increase code quality of existing code and ensure code quality of new code. Since there are many FxCop violations in this repository, I'm breaking up the large change in to several smaller changes based on project. I will add FxCopAnalyzers to our project Packages.props once the package is enabled everywhere. This is part of #27 ## Changes * Adds FxCopAnalyzers to KissTnc and KissTncUnitTests projects * Fixes FxCop violations in those projects ## Validation * `dotnet build -c Release` is successful (no violations) on my machine * Tests are running successfully
## Description Follow up to #54 as work on #27. This enables FxCopAnalyzers in `src/AprsParser` directory. ## Changes * Disables CA1805:DoNotInitializeUnnecessarily, which disallows initializing a variable to a default value, as I believe it goes against self-documenting code * Reverts a few lines in `src/KissTnc` that were modified for CA1805 * Enables FxCop in AprsParser project by adding the nuget package to the project * Fixes violations in `src/AprsParser` * Updates AprsParserUnitTests as required ## Validation * `dotnet build -c Release` at root succeeds * All tests are passing * Console app successfully receives packets from APRS-IS
## Description Follows up on #60 to enable FxCop in the AprsParserUnitTests. Part of #27. ## Changes * Enables FxCop in the AprsParserUnitTests project * Switches test methods to reuse code with inline data * Renamed PacketUnitTests.cs to PacketInformationFieldUnitTests.cs to segment from future tests and keep test file sizes lower * Added some more specific skip messages in a few test methods linking to new issues in GitHub * Fixed one bug in decoding a comment on a maidenhead packet that was revealed while refactoring tests * Other fixes ## Validation * Build passes (`dotnet build -c Release` at the root) * Tests pass (`dotnet test` at the root)
As per conversation here: dotnet/roslyn#33558 and here https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#enable-on-build, enabling more analyzers on the build (such as the IDExxxx error codes) requires .NET 5 or higher. This is similar to #81, which would also require a newer .NET version. |
Microsoft.CodeAnalysis.FxCopAnalyzers
IDisposableAnalyzers
The text was updated successfully, but these errors were encountered: