Linter: revive, Rule: import-alias-naming
- Enforces clear and lowercase import alias names. Should we enable it?
#15820
Labels
Description
This issue starts a discussion about enabling:
Configuration:
Configuration (1): (
string
) as plain string accepts allow regexp pattern for aliases (default:^[a-z][a-z0-9]{0,}$
).Configuration (2): (
map[string]string
) as a map accepts two values:allowRegex
accepts allow regexp patterndenyRegex
deny regexp patternNote: If both
allowRegex
anddenyRegex
are provided, the alias must comply with both of them.If none are given (i.e. an empty map), the default value
^[a-z][a-z0-9]{0,}$
for allowRegex is used.Unknown keys will result in an error.
Example configuration:
Example (1):
Example (2):
Expected output
Decision about enabling or not enabling this rule.
Findings
For this rule (with above configuration 2), the following findings were found in the current codebase:
The text was updated successfully, but these errors were encountered: