Skip to content

Commit

Permalink
chore: Enforce coding styles on build (#242)
Browse files Browse the repository at this point in the history
## This PR
A follow on from the previous PR that removed unused using, this will
make sure it won't occur in the future.
#240 (comment)

- Enforce code styles on build
- Error on unused usings
- Apply workaround for IDE0005 rule

### Related Issues
Fixes
#240 (comment)

Signed-off-by: Benjamin Evenson <2031163+benjiro@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
  • Loading branch information
benjiro and toddbaert authored Feb 26, 2024
1 parent fa25ece commit 64699c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,13 @@ dotnet_diagnostic.IDE0001.severity = warning
dotnet_diagnostic.IDE0002.severity = warning

# IDE0005: Remove unnecessary import
# Workaround for https://github.com/dotnet/roslyn/issues/41640
dotnet_diagnostic.IDE0005.severity = none
dotnet_diagnostic.IDE0005.severity = error

# RS0041: Public members should not use oblivious types
dotnet_diagnostic.RS0041.severity = suggestion

# CA2007: Do not directly await a Task
dotnet_diagnostic.CA2007.severity = error
dotnet_diagnostic.CA2007.severity = errorgit

[obj/**.cs]
generated_code = true
Expand Down
3 changes: 3 additions & 0 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<LangVersion>latest</LangVersion>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<!-- Workaround for IDE0005 (Remove unnecessary usings/imports); see https://github.com/dotnet/roslyn/issues/41640 -->
<NoWarn>EnableGenerateDocumentationFile</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down

0 comments on commit 64699c8

Please sign in to comment.