sonar-dotnet icon indicating copy to clipboard operation
sonar-dotnet copied to clipboard

S101: Configuration for custom acronyms

Open dnperfors opened this issue 5 years ago • 6 comments

Description

On our project we have some three and four letter acronyms, that are part of a specification. These acronyms are used in code, but they will trigger S101. Would it be possible to add a file to the project that describe what acronyms are allowed, or should be written, for example in a similar way as the CustomDictionary.xml file that is used by CA1709

Repro steps

Create a class with the name NSAInformer

Expected behavior

Warning S101 is not given for NSAInformer, because NSA is the established capitalized 3 letter acronym in our specification.

Actual behavior

Warning S101 is given NSAInfomer, telling me that it should be NsaInformer

Known workarounds

Suppress S101 in all cases where the NSA acronym is used

Related information

  • SonarAnalyzer.CSharp version 7.14.0.8411
  • Visual Studio Version 2019 (16.1.1)

dnperfors avatar Jun 04 '19 14:06 dnperfors

related to #320 - relax the restrictions

RSPEC-101

SonarWay Default Severity:Minor Impact:Low Likelihood:Low

Is there an ETA for this? It seems like a basic feature that comes out-of-the-box with Visual Studio and Resharper. We ended up ignoring all S101 errors because of this lack of configuration to allow for custom known acronyms.

ericregnier avatar Oct 26 '21 07:10 ericregnier

Yeah, this one feels annoying. Ideally it should take the resharper .DotSettings and the VS equivalent to ignore certain abbreviations. Alternatively use your own dictionary, that could be generated then from existing files by the community. As it stands now, we will also just ignore S101 :(

MichelZ avatar Nov 18 '21 09:11 MichelZ

@andrei-epure-sonarsource any updates? :)

ericregnier avatar Nov 20 '21 06:11 ericregnier

@andrei-epure-sonarsource Hello, any updates? It would be great to have something like this. Otherwise we start to ignore S101 as well. And I'm really not in favor with this approach.

HaGGi13 avatar May 10 '22 14:05 HaGGi13