diktat
diktat copied to clipboard
Add excludes (`List<String>`) property to configuration file like Detekt has
Some suggestions: Add an excludes: ['SomeStringToExclude'] property to many rules.
Intention: I get 2 different warnings for an interface file with the name XModemPacket.kt
[FILE_NAME_INCORRECT] file name is incorrect - it should end with .kt extension and be in PascalCase: XModemPacket.kt
[CLASS_NAME_INCORRECT] class/enum/interface name should be in PascalCase and should contain only latin (ASCII) letters or numbers: XModemPacket
XModem is a term, so it makes sense to name this file as it is. So an excludes property for this rule would exclude specific file names, e.g. excludes*: ['XModemPacket'] or excludes*: ['XModem*']
You can also update the documentation in config file for [FILE_NAME_INCORRECT]. There is stated:
Checks that file name has extension
Append to the statement that this rule is also checking for PascalCase, as stated in the warning --> it should end with .kt extension and be in PascalCase
This would be a really useful feature.
I have found something else. In config file is stated for CLASS_NAME_INCORRECT:
Checks that the Class/Enum/Interface name does not match Pascal case
It should be "Checks that the Class/Enum/Interface name does match PascalCase.