Skip to content

Commit 9b7be38

Browse files
author
Ruben Schmidmeister
authored
Merge pull request #44 from messerli-informatik-ag/improve-docs
Improve Readme
2 parents 259a47e + 9577836 commit 9b7be38

File tree

1 file changed

+65
-9
lines changed

1 file changed

+65
-9
lines changed

readme.md

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,71 @@
66

77
## Usage
88

9-
Add the following import to your `csproj` or `Directory.Build.props`:
10-
11-
```xml
12-
<?xml version="1.0" encoding="utf-8"?>
13-
<Project>
14-
<ItemGroup>
15-
<PackageReference Include="Messerli.CodeStyle" Version="1.2.0" PrivateAssets="all" />
16-
</ItemGroup>
17-
</Project>
9+
### Without the CentralPackageVersions SDK
10+
11+
Add the following package reference to your project or to your `Directory.Build.props`:
12+
13+
```diff
14+
<?xml version="1.0" encoding="utf-8"?>
15+
<Project>
16+
<ItemGroup>
17+
+ <PackageReference Include="Messerli.CodeStyle" Version="1.2.1" PrivateAssets="all" />
18+
</ItemGroup>
19+
</Project>
20+
```
21+
22+
### With the CentralPackageVersions SDK
23+
24+
Add `Messerli.CodeStyle` to your `Packages.props`:
25+
```diff
26+
<?xml version="1.0" encoding="utf-8"?>
27+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
28+
<ItemGroup Label="Build dependencies">
29+
+ <PackageReference Update="Messerli.CodeStyle" Version="1.2.1" />
30+
</ItemGroup>
31+
</Project>
32+
```
33+
34+
Add the following package reference to your project or to your `Directory.Build.props`:
35+
```diff
36+
<?xml version="1.0" encoding="utf-8"?>
37+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
38+
+ <ItemGroup>
39+
+ <PackageReference Include="Messerli.CodeStyle" PrivateAssets="all" />
40+
+ </ItemGroup>
41+
</Project>
1842
```
1943

44+
## Warnings as Errors
2045

46+
Some analyzer rules, such as rules involving single line comments, are configured as warnings to facilitate development.
47+
To enforce these rules, enable `TreatWarningsAsErrors` for CI builds.
48+
49+
```diff
50+
- dotnet build --no-restore
51+
+ dotnet build --no-restore /p:TreatWarningsAsErrors=true
52+
```
53+
54+
### Github Actions
55+
```diff
56+
jobs:
57+
build:
58+
steps:
59+
# ...
60+
- name: Build
61+
- run: dotnet build --no-restore
62+
+ run: dotnet build --no-restore /p:TreatWarningsAsErrors=true
63+
# ...
64+
```
65+
66+
### Azure Devops
67+
```diff
68+
steps:
69+
# ...
70+
- task: DotNetCoreCLI@2
71+
displayName: Build
72+
inputs:
73+
- arguments: '--no-restore'
74+
+ arguments: '--no-restore /p:TreatWarningsAsErrors=true'
75+
# ...
76+
```

0 commit comments

Comments
 (0)