Skip to content
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

Adding .editorconfig breaks TreatWarningsAsErrors #56

Closed
JimBobSquarePants opened this issue Jun 15, 2021 · 6 comments
Closed

Adding .editorconfig breaks TreatWarningsAsErrors #56

JimBobSquarePants opened this issue Jun 15, 2021 · 6 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@JimBobSquarePants
Copy link

Describe the bug

Adding the .editorconfig file from repo main breaks TreatWarningsAsErrors

To Reproduce

  1. Download the attached project ErrorsTest.zip
  2. Set build configuration to Release and build.
  3. StyleCop warnings are not treated as errors and do not cause the build to fail.
  4. Remove .editorconfig file and rebuild. Build will fail.

Expected behaviour

When the build configuration is set to release the build should fail.

Rules

Provide links to any rules in question.

@JimBobSquarePants JimBobSquarePants added the bug Issues describing a bug or pull requests fixing a bug. label Jun 15, 2021
@JimBobSquarePants
Copy link
Author

JimBobSquarePants commented Jun 15, 2021

Removing this line appears to fix the issue.

[*.{cs,csx,cake,vb,vbx}]
# Default Severity for all .NET Code Style rules below
dotnet_analyzer_diagnostic.severity = warning

Replacing with specific defaults is advised otherwise all warnings become errors.
e.g.

dotnet_analyzer_diagnostic.category-style.severity = warning

Related issue
dotnet/roslyn#43051

@RehanSaeed
Copy link
Owner

Thanks @JimBobSquarePants! I was following that Roslyn thread and thought this was fixed since they closed the issue but perhaps not.

Which version of VS are you using? dotnet_analyzer_diagnostic.severity should have been working since VS 16.9 onwards but I wonder if there have been bug fixes in 16.10 or 16.11 preview.

@JimBobSquarePants
Copy link
Author

No worries 😄
I'm using VS 16.10.

@RehanSaeed
Copy link
Owner

Raised new issue dotnet/roslyn#55541.

@JimBobSquarePants
Copy link
Author

Looks like there was a fix for this issue. Perhaps it can be closed now?

dotnet/roslyn#58460

@RehanSaeed
Copy link
Owner

Looks like the fix was rolled out in 17.2. Closing. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

2 participants