Can't suppress IDE0055 through editorconfig
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
**Version Used**: dotnet format version `10.0.301-servicing.26270.133+96856fd726ffd058fb3dfef0851dbafc7ef3b011`
**Steps to Reproduce**:
Create a WHITESPACE error and suppress IDE0055 in `.editorconfig`.
E.g., specify the following in `.editorconfig`:
```
dotnet_diagnostic.IDE0055.severity = none # Or omit this; what is the default?
csharp_space_after_comma = true
```
And use the following code:
```
class Program
{
void Test(int a,int b)
{
}
}
```
**Expected Behavior**: No `WHITESPACE` error to be reported by `dotnet format`. Note: using a pragma suppression of IDE0055 _does_ work.
**Actual Behavior**: A `WHITESPACE` error is reported, regardless of `dotnet_diagnostic.IDE0055.severity` configuration.
Interestingly, [using .NET lab and adding a suppression](https://lab.razor.fyi/#lVHRahNBFCUgRfdJ_ILL9mVX0k0qFCXSYrtJJFJtMK2CIjjZvbsZnMws984m2UrffBF88gfE3xI_wEf_QNlN0sYYis7DnZlzz7kz91yn6zh9MimJcRDxnQeREsywQJz3DgDAxMgYTpGtJ7UFUS_j0K9Sc8KFc3H3x1ajAT-_fP4Kp71-C3qaLYoYTAJ2JLkOhckhEhpyRoglYWTlBBmkhnAbEqmQF7AqwDMEh3EMB9C-ZPp1SAwBzsQ4U9hyGg0A2G5lZDIkW0BodCLTnISVRu-3cZinjjMHg3AwEpT1BTGeZGWePTPfYf8AFseqk-CltKNjodNcpPgCiaXR3to96BNOJE79K0WfMCMTIbOhQTEeGsWe2-4cnT12V1hdFDYnZK-CXlexXBqnnpsz7pBhVegda96hludIbh1cSzm6fv1PclcqPBKM8WJQ68Q3vuM_XGs_NONMqsqefzHhUCkzPdMsEvTK0it9PMuVEkOFodEWZ3ZZbTMcdHQJrsjLxFieVz85xgkq7y8kqOa3ohlkGMlERm0pUm3Yymj56iYvw8Hu_eauW4fnmBmyV6JgkGcZIfO6oZXi3v8oeu1Os7m3d61kwyw6Y3lp2HX2l7ynaEUsrDjRqvASoRirUo9-LVftyRYSGeJXt25--PTx-7f09o23tVntNw) using `WithSpecificDiagnosticOptions` does result in the error not showing up in the online editor. So, maybe it is specifically related to how `.editorconfig` settings are mapped to suppressions?
Contributor guide
Research direction
Start by reproducing the reported WHITESPACE diagnostic with dotnet format and the shown .editorconfig settings. Compare how the editorconfig severity is mapped with the WithSpecificDiagnosticOptions behavior described in the issue; done means suppressing IDE0055 prevents the WHITESPACE error while formatting still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100