-
Notifications
You must be signed in to change notification settings - Fork 316
Open
Labels
Description
In v1.8.0 (PR #1272), we allowed kebab-cased options. Kebab-case is now preferred for option naming because it's common across linters. For example, we use max-lit-count instead of camelCased maxLitCount.
In Golangci-lint, the vast majority of linters use kebab-case. See .golangci.reference.yml.
I propose simplifying RULES_DESCRIPTIONS.md by deleting examples that show lowercased and camelCased options. This would slightly simplify the documentation and make it more consistent.
What to do
- Remove camelCased and lowerCased options from the documentation (RULES_DESCRIPTIONS.md, README.md etc.).
- Add a section explaining that camelCased and lowerCased options are still supported for all rules, but are deprecated and should be avoided.
- Do not touch code or tests for now. In the future, we plan to stop supporting camelCase completely, but for now it should remain supported.
Example
The documentation for the add-constant rule should be as follows:
Details
add-constant
Description: Suggests using constant for magic numbers
and string literals.
Configuration:
max-lit-count: (string) maximum number of instances of a string literal that are tolerated before warn.allow-strs: (string) comma-separated list of allowed string literalsallow-ints: (string) comma-separated list of allowed integersallow-floats: (string) comma-separated list of allowed floatsignore-funcs: (string) comma-separated list of function names regexp patterns to exclude
Configuration examples:
[rule.add-constant]
arguments = [
{ max-lit-count = "3", allow-strs = "\"\"", allow-ints = "0,1,2", allow-floats = "0.0,0.,1.0,1.,2.0,2.", ignore-funcs = "os\\.*,fmt\\.Println,make" },
]Reactions are currently unavailable