Skip to content

Commit 1a05a6b

Browse files
committed
Update README
1 parent bd4db90 commit 1a05a6b

File tree

4 files changed

+76
-20
lines changed

4 files changed

+76
-20
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and adheres to a project-specific [Versioning](/README.md).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Improved README by describing the purpose, usage, and versioning of the package.
13+
- Adds repository and icon information to the test ruleset NuGet package.
14+
1015
### Changed
1116

1217
- Updated SonarAnalyzer.CSharp to version 9.32.0.97167

Neolution.CodeAnalysis.TestsRuleset.nuspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<authors>Neolution AG</authors>
88
<description>Configures Code Analysis for Neolution Test Projects.</description>
99
<projectUrl>https://github.com/neolution-ch/Neolution.CodeAnalysis</projectUrl>
10+
<repository type="git" url="https://github.com/neolution-ch/Neolution.CodeAnalysis" />
11+
<icon>icon.png</icon>
12+
<tags>code analysis;roslyn;stylecop;sonar;ruleset</tags>
1013
<readme>docs\README.md</readme>
1114
<license type="expression">MIT</license>
1215
<requireLicenseAcceptance>false</requireLicenseAcceptance>

README.md

Lines changed: 67 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,74 @@
1-
# Neolution Code Analysis rulesets
2-
We maintain two (opinionated) rulesets for all our projects and distribute them, including 3rd-party Roslyn Analyzers (StyleCop and SonarSource) in two respective NuGet packages.
1+
# Neolution Code Analysis Rulesets
32

4-
- For Libraries, Tools, Web, UI and other projects
5-
- [Neolution.CodeAnalysis](https://www.nuget.org/packages/Neolution.CodeAnalysis/)
6-
- For projects containing automated tests (less strict rules)
7-
- [Neolution.CodeAnalysis.TestsRuleset](https://www.nuget.org/packages/Neolution.CodeAnalysis.TestsRuleset/)
3+
[![NuGet](https://img.shields.io/nuget/v/Neolution.CodeAnalysis.svg)](https://www.nuget.org/packages/Neolution.CodeAnalysis/)
4+
[![NuGet](https://img.shields.io/nuget/v/Neolution.CodeAnalysis.TestsRuleset.svg)](https://www.nuget.org/packages/Neolution.CodeAnalysis.TestsRuleset/)
85

9-
## Decisions and opinions
10-
The base ruleset consists of the default ruleset of the Roslyn Analyzers we include in the NuGet package and those used in our build tools.
6+
**Neolution.CodeAnalysis** provides a plug-and-play code analysis standard for .NET projects. By adding this package, you instantly enforce consistent, high-quality code with minimal setup—no need to maintain your own ruleset or configuration. The package includes:
117

12-
- We include our own opinionated ruleset with adjusted Analyzer severities as a [Global AnalyzerConfig](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig)
13-
- In all build configurations other that `Debug`, warnings will be converted to errors.
14-
- We include our own [stylecop.json](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/Configuration.md) configuration file.
8+
- Pre-configured Roslyn analyzers (StyleCop, SonarSource)
9+
- Strict and up-to-date rules for code quality and security
10+
- Automatic conversion of warnings to errors (except in Debug)
11+
- A single source of truth for code style and best practices
12+
- Easy updates: just bump the package version to get the latest rules
13+
14+
**Why use this package?**
15+
16+
- Save time on code reviews by catching issues early
17+
- Ensure all projects follow the same standards
18+
- Reduce technical debt and improve maintainability
19+
- Onboard new developers faster with clear, enforced guidelines
20+
- **Flexible:** You can override any rules or severities in your own `.editorconfig` files at the project or solution level to fit your team's needs.
21+
22+
## Packages
23+
24+
- **[Neolution.CodeAnalysis](https://www.nuget.org/packages/Neolution.CodeAnalysis/):** For libraries, tools, web, UI, and other projects.
25+
- **[Neolution.CodeAnalysis.TestsRuleset](https://www.nuget.org/packages/Neolution.CodeAnalysis.TestsRuleset/):** For test projects (less strict rules).
26+
27+
## Installation
28+
29+
Install via NuGet Package Manager:
30+
31+
```shell
32+
Install-Package Neolution.CodeAnalysis
33+
```
34+
35+
or for test projects:
36+
37+
```shell
38+
Install-Package Neolution.CodeAnalysis.TestsRuleset
39+
```
40+
41+
Or add the following to your `.csproj`:
42+
43+
```xml
44+
<ItemGroup>
45+
<PackageReference Include="Neolution.CodeAnalysis" Version="*">
46+
<PrivateAssets>all</PrivateAssets>
47+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
48+
</PackageReference>
49+
</ItemGroup>
50+
```
1551

1652
## Versioning
17-
Given a version number `MAJOR.MINOR.PATCH`, an incremented number for:
1853

19-
- `MAJOR` version means there are incompatible changes with the previous version,
20-
- `MINOR` version means functionality and rules were added, and
21-
- `PATCH` version means that the changes are all completely backwards compatible. Usually when rules were lowered in severity or disabled/removed.
54+
- **MAJOR**: Incompatible changes, may require significant refactoring
55+
- **MINOR**: New rules or rule changes, may break the build
56+
- **PATCH**: Safe to update, only disables or lowers severity of rules
57+
58+
See [CHANGELOG.md](./CHANGELOG.md) for details.
59+
60+
## License
61+
62+
This project is licensed under the [MIT License](./LICENSE).
63+
64+
## Contributing
65+
66+
Contributions, issues, and feature requests are welcome! Please open an issue or pull request on [GitHub](https://github.com/neolution-ch/Neolution.CodeAnalysis).
67+
68+
> **Note:** The ruleset is intentionally opinionated and curated by Neolution to reflect our collective experience and values. While we welcome feedback and suggestions, changes to the rules themselves are carefully considered to maintain consistency across projects. If your requirements differ significantly, you are welcome to fork the package and adapt it to your needs.
69+
70+
## Links
2271

23-
### What it means in practice:
24-
- You can (and should) always update the package to the latest `PATCH` version whenever you have the chance to do it, it should never break the build.
25-
- Updating to the latest `MINOR` version can break the build and may require minor refactorings. But you can expect to have Roslyn code fixes and/or documentation available for the changes that are needed to fix the build.
26-
- `MAJOR` updates will break your build and may require major refactorings.
72+
- [Source on GitHub](https://github.com/neolution-ch/Neolution.CodeAnalysis)
73+
- [NuGet: Neolution.CodeAnalysis](https://www.nuget.org/packages/Neolution.CodeAnalysis/)
74+
- [NuGet: Neolution.CodeAnalysis.TestsRuleset](https://www.nuget.org/packages/Neolution.CodeAnalysis.TestsRuleset/)

build/Neolution.CodeAnalysis.globalconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ dotnet_diagnostic.S6931.severity = none
276276

277277
# S6678: Use PascalCase for named placeholders
278278
; Team decided that enforcing this rule is not worth the effort
279-
dotnet_diagnostic.S6678.severity = none
279+
dotnet_diagnostic.S6678.severity = suggestion
280280

281281
# S6964: Value type property used as input in a controller action should be nullable, required or annotated with the JsonRequiredAttribute to avoid under-posting
282282
; This is handled by a custom model binder in our project templates that produces a bad request response in case of under-posting

0 commit comments

Comments
 (0)