Rule CA1709 and two letter words

I have a library with many functions that use two non-English words, such as:

  • Findeadia
  • ESPRIMO
  • Enpreparacion
  • ...

In any case, I activated code analysis for the project, and I get warning CA1709:

CA1709 : Microsoft.Naming : Corrija el uso de mayúsculas y minúsculas en 'De' en el nombre del miembro '...' cambiándolo a 'DE'. 

I have added a code analysis dictionary, as indicated here , but it does not ignore warnings. Here is the structure of the dictionary.

 <?xml version="1.0" encoding="utf-8" ?> <Dictionary> <Words> <Recognized> <Word>de</Word> <Word>el</Word> <Word>en</Word> <Word>es</Word> <Word>si</Word> ... </Recognized> </Words> </Dictionary> 

What else should I do to handle this warning? Without suppressing the message?

early

+4
source share
1 answer

You need to add them as CasingExceptions , as well as:

  <Acronyms> <CasingExceptions> <Acronym>De</Acronym> <Acronym>El</Acronym> <Acronym>En</Acronym> <Acronym>Es</Acronym> <Acronym>Si</Acronym> </CasingExceptions> </Acronyms> </Dictionary> 

EDIT: Just keep in mind that this is somewhat of a misnomer, since none of these words is an abbreviation. You might prefer to disable these specific rules. After all, many code analysis rules are based on the assumption that the API is written in English.

+3
source

Source: https://habr.com/ru/post/1336981/


All Articles