Naming Rule Set
The naming ruleset contains rules which assert the naming of different parts of the codebase.
BooleanPropertyNaming
Reports when a boolean property doesn't match a pattern
Active by default: No
Requires Type Resolution
Debt: 5min
Configuration options:
-
allowedPattern
(default:'^(is|has|are)'
)naming pattern
-
(default:ignoreOverridden
true
)Deprecated: This configuration is ignored and will be removed in the future
ignores properties that have the override modifier
Noncompliant Code:
val progressBar: Boolean = true
Compliant Code:
val hasProgressBar: Boolean = true
ClassNaming
Reports class or object names that do not follow the specified naming convention.
Active by default: Yes - Since v1.0.0
Debt: 5min
Aliases: ClassName
Configuration options:
-
classPattern
(default:'[A-Z][a-zA-Z0-9]*'
)naming pattern
ConstructorParameterNaming
Reports constructor parameter names that do not follow the specified naming convention.
Active by default: Yes - Since v1.0.0
Debt: 5min
Configuration options:
-
parameterPattern
(default:'[a-z][A-Za-z0-9]*'
)naming pattern
-
privateParameterPattern
(default:'[a-z][A-Za-z0-9]*'
)naming pattern
-
excludeClassPattern
(default:'$^'
)ignores variables in classes which match this regex
-
(default:ignoreOverridden
true
)Deprecated: This configuration is ignored and will be removed in the future
ignores constructor properties that have the override modifier
EnumNaming
Reports enum names that do not follow the specified naming convention.
Active by default: Yes - Since v1.0.0
Debt: 5min
Configuration options:
-
enumEntryPattern
(default:'[A-Z][_a-zA-Z0-9]*'
)naming pattern
ForbiddenClassName
Reports class names which are forbidden per configuration. By default, this rule does not report any classes.
Examples for forbidden names might be too generic class names like ...Manager
.
Active by default: No
Debt: 5min
Configuration options:
-
forbiddenName
(default:[]
)forbidden class names
FunctionMaxLength
Reports when very long function names are used.
Active by default: No
Debt: 5min
Configuration options:
-
maximumFunctionNameLength
(default:30
)maximum name length
FunctionMinLength
Reports when very short function names are used.
Active by default: No
Debt: 5min
Configuration options:
-
minimumFunctionNameLength
(default:3
)minimum name length
FunctionNaming
Reports function names that do not follow the specified naming convention. One exception are factory functions used to create instances of classes. These factory functions can have the same name as the class being created.
Active by default: Yes - Since v1.0.0
Debt: 5min
Aliases: FunctionName
Configuration options:
-
functionPattern
(default:'[a-z][a-zA-Z0-9]*'
)naming pattern
-
excludeClassPattern
(default:'$^'
)ignores functions in classes which match this regex
-
(default:ignoreOverridden
true
)Deprecated: This configuration is ignored and will be removed in the future
ignores functions that have the override modifier
FunctionParameterNaming
Reports function parameter names that do not follow the specified naming convention.
Active by default: Yes - Since v1.0.0
Debt: 5min
Configuration options:
-
parameterPattern
(default:'[a-z][A-Za-z0-9]*'
)naming pattern
-
excludeClassPattern
(default:'$^'
)ignores variables in classes which match this regex
-
(default:ignoreOverriddenFunctions
true
)Deprecated: Use
ignoreOverridden
insteadignores overridden functions with parameters not matching the pattern
-
(default:ignoreOverridden
true
)Deprecated: This configuration is ignored and will be removed in the future
ignores overridden functions with parameters not matching the pattern
InvalidPackageDeclaration
Reports when the file location does not match the declared package.
Active by default: Yes - Since v1.21.0
Debt: 5min
Aliases: PackageDirectoryMismatch
Configuration options:
-
rootPackage
(default:''
)if specified this part of the package structure is ignored
-
requireRootInDeclaration
(default:false
)requires the declaration to start with the specified rootPackage
LambdaParameterNaming
Reports lambda parameter names that do not follow the specified naming convention.
Active by default: No
Debt: 5min