Skip to content

Commit 3ece811

Browse files
committed
Added readme section 'How does inheritance work' with drawings
1 parent a4d285e commit 3ece811

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,27 @@ This means that atc-coding-rules only use the following severity:
8282
Read about severity-level:
8383
* [configuration-options => severity-level](https://docs.microsoft.com/da-dk/dotnet/fundamentals/code-analysis/configuration-options#severity-level)
8484
* [configure-severity-levels meaning for Visual Studio](https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019#configure-severity-levels)
85+
86+
87+
### Q: How does inheritance work for project properties
88+
89+
Imagine the we want to set the `LangVersion` property. To do this we can set it directly in the `.csproj` file or it can be set in a `Directory.Build.props` file - or both file types. The `MSBuild` or `dotnet build` use the file hierarchy of `Directory.Build.props` and `.csproj` to read the value as the `LangVersion` property.
90+
The important here is, that the last defination wins.
91+
92+
Se example:
93+
94+
![Img](docs/fig-project-properties.png)
95+
96+
The `LangVersion` property value will be read as: ~~7.0~~ => ~~8.0~~ => **9.0**
97+
98+
99+
### Q: How does inheritance work for severity level for a rule
100+
101+
Imagine the we want to set the severity level for a rule `SA1633`. To do this we can set it in the `.editorconfig` file and it can be set multiples times. The editor like `Visual Studio` or `VS Code` use the file hierarchy of `.editorconfig` to read the **key**/value pair as the `dotnet_diagnostic.SA1633.severity`.
102+
The important here is, that the last key/**value** pair defination wins.
103+
104+
Se example:
105+
106+
![Img](docs/fig-editorconfig.png)
107+
108+
The `dotnet_diagnostic.SA1633.severity` value will be read as: ~~none~~ => ~~error~~ => ~~suggestion~~ => **none**

docs/Figures.pptx

37.2 KB
Binary file not shown.

docs/fig-editorconfig.png

99.9 KB
Loading

docs/fig-project-properties.png

91.6 KB
Loading

0 commit comments

Comments
 (0)