1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-29 21:47:12 +02:00

Doc rules description ()

* partial document

* complete list of rules descriptions

* Links rules in README to corresponding descriptions

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Co-Authored-By: chavacava <salvadorcavadini+github@gmail.com>

* Update RULES_DESCRIPTIONS.md

Includes @mgechev remarks
This commit is contained in:
SalvadorC 2018-10-26 05:15:13 +02:00 committed by Minko Gechev
parent 3c177e2824
commit 3ef16e4c45
2 changed files with 487 additions and 47 deletions

@ -231,53 +231,53 @@ List of all available rules. The rules ported from `golint` are left unchanged a
| Name | Config | Description | `golint` | Typed |
| --------------------- | :----: | :--------------------------------------------------------------- | :------: | :---: |
| `context-keys-type` | n/a | Disallows the usage of basic types in `context.WithValue`. | yes | yes |
| `time-naming` | n/a | Conventions around the naming of time variables. | yes | yes |
| `var-declaration` | n/a | Reduces redundancies around variable declaration. | yes | yes |
| `unexported-return` | n/a | Warns when a public return is from unexported type. | yes | yes |
| `errorf` | n/a | Should replace `errors.New(fmt.Sprintf())` with `fmt.Errorf()` | yes | yes |
| `blank-imports` | n/a | Disallows blank imports | yes | no |
| `context-as-argument` | n/a | `context.Context` should be the first argument of a function. | yes | no |
| `dot-imports` | n/a | Forbids `.` imports. | yes | no |
| `error-return` | n/a | The error return parameter should be last. | yes | no |
| `error-strings` | n/a | Conventions around error strings. | yes | no |
| `error-naming` | n/a | Naming of error variables. | yes | no |
| `exported` | n/a | Naming and commenting conventions on exported symbols. | yes | no |
| `if-return` | n/a | Redundant if when returning an error. | yes | no |
| `increment-decrement` | n/a | Use `i++` and `i--` instead of `i += 1` and `i -= 1`. | yes | no |
| `var-naming` | whitelist & blacklist of initialisms | Naming rules. | yes | no |
| `package-comments` | n/a | Package commenting conventions. | yes | no |
| `range` | n/a | Prevents redundant variables when iterating over a collection. | yes | no |
| `receiver-naming` | n/a | Conventions around the naming of receivers. | yes | no |
| `indent-error-flow` | n/a | Prevents redundant else statements. | yes | no |
| `argument-limit` | int | Specifies the maximum number of arguments a function can receive | no | no |
| `cyclomatic` | int | Sets restriction for maximum Cyclomatic complexity. | no | no |
| `max-public-structs` | int | The maximum number of public structs in a file. | no | no |
| `file-header` | string | Header which each file should have. | no | no |
| `empty-block` | n/a | Warns on empty code blocks | no | no |
| `superfluous-else` | n/a | Prevents redundant else statements (extends `indent-error-flow`) | no | no |
| `confusing-naming` | n/a | Warns on methods with names that differ only by capitalization | no | no |
| `get-return` | n/a | Warns on getters that do not yield any result | no | no |
| `modifies-parameter` | n/a | Warns on assignments to function parameters | no | no |
| `confusing-results` | n/a | Suggests to name potentially confusing function results | no | no |
| `deep-exit` | n/a | Looks for program exits in funcs other than `main()` or `init()` | no | no |
| `unused-parameter` | n/a | Suggests to rename or remove unused function parameters | no | no |
| `unreachable-code` | n/a | Warns on unreachable code | no | no |
| `add-constant` | map | Suggests using constant for magic numbers and string literals | no | no |
| `flag-parameter` | n/a | Warns on boolean parameters that create a control coupling | no | no |
| `unnecessary-stmt` | n/a | Suggests removing or simplifying unnecessary statements | no | no |
| `struct-tag` | n/a | Checks common struct tags like `json`,`xml`,`yaml` | no | no |
| `modifies-value-receiver` | n/a | Warns on assignments to value-passed method receivers | no | yes |
| `constant-logical-expr` | n/a | Warns on constant logical expressions | no | no |
| `bool-literal-in-expr`| n/a | Suggests removing Boolean literals from logic expressions | no | no |
| `redefines-builtin-id`| n/a | Warns on redefinitions of builtin identifiers | no | no |
| `function-result-limit` | int | Specifies the maximum number of results a function can return | no | no |
| `imports-blacklist` | []string | Disallows importing the specified packages | no | no |
| `range-val-in-closure`| n/a | Warns if range value is used in a closure dispatched as goroutine| no | no |
| `waitgroup-by-value` | n/a | Warns on functions taking sync.WaitGroup as a by-value parameter | no | no |
| `atomic` | n/a | Check for common mistaken usages of the `sync/atomic` package | no | no |
| `empty-lines` | n/a | Warns when there are heading or trailing newlines in a block | no | no |
| `line-lenght-limit` | int | Specifies the maximum number of characters in a line | no | no |
| [`context-keys-type`](./RULES_DESCRIPTIONS.md#context-key-types) | n/a | Disallows the usage of basic types in `context.WithValue`. | yes | yes |
| [`time-naming`](./RULES_DESCRIPTIONS.md#time-naming) | n/a | Conventions around the naming of time variables. | yes | yes |
| [`var-declaration`](./RULES_DESCRIPTIONS.md#var-declaration) | n/a | Reduces redundancies around variable declaration. | yes | yes |
| [`unexported-return`](./RULES_DESCRIPTIONS.md#unexported-return) | n/a | Warns when a public return is from unexported type. | yes | yes |
| [`errorf`](./RULES_DESCRIPTIONS.md#errorf) | n/a | Should replace `errors.New(fmt.Sprintf())` with `fmt.Errorf()` | yes | yes |
| [`blank-imports`](./RULES_DESCRIPTIONS.md#blank-imports) | n/a | Disallows blank imports | yes | no |
| [`context-as-argument`](./RULES_DESCRIPTIONS.md#context-as-argument) | n/a | `context.Context` should be the first argument of a function. | yes | no |
| [`dot-imports`](./RULES_DESCRIPTIONS.md#dot-imports) | n/a | Forbids `.` imports. | yes | no |
| [`error-return`](./RULES_DESCRIPTIONS.md#error-return) | n/a | The error return parameter should be last. | yes | no |
| [`error-strings`](./RULES_DESCRIPTIONS.md#error-strings) | n/a | Conventions around error strings. | yes | no |
| [`error-naming`](./RULES_DESCRIPTIONS.md#error-naming) | n/a | Naming of error variables. | yes | no |
| [`exported`](./RULES_DESCRIPTIONS.md#exported) | n/a | Naming and commenting conventions on exported symbols. | yes | no |
| [`if-return`](./RULES_DESCRIPTIONS.md#if-return) | n/a | Redundant if when returning an error. | yes | no |
| [`increment-decrement`](./RULES_DESCRIPTIONS.md#increment-decrement) | n/a | Use `i++` and `i--` instead of `i += 1` and `i -= 1`. | yes | no |
| [`var-naming`](./RULES_DESCRIPTIONS.md#var-naming) | whitelist & blacklist of initialisms | Naming rules. | yes | no |
| [`package-comments`](./RULES_DESCRIPTIONS.md#package-comments) | n/a | Package commenting conventions. | yes | no |
| [`range`](./RULES_DESCRIPTIONS.md#range) | n/a | Prevents redundant variables when iterating over a collection. | yes | no |
| [`receiver-naming`](./RULES_DESCRIPTIONS.md#receiver-naming) | n/a | Conventions around the naming of receivers. | yes | no |
| [`indent-error-flow`](./RULES_DESCRIPTIONS.md#indent-error-flow) | n/a | Prevents redundant else statements. | yes | no |
| [`argument-limit`](./RULES_DESCRIPTIONS.md#argument-limit) | int | Specifies the maximum number of arguments a function can receive | no | no |
| [`cyclomatic`](./RULES_DESCRIPTIONS.md#cyclomatic) | int | Sets restriction for maximum Cyclomatic complexity. | no | no |
| [`max-public-structs`](./RULES_DESCRIPTIONS.md#max-public-structs) | int | The maximum number of public structs in a file. | no | no |
| [`file-header`](./RULES_DESCRIPTIONS.md#file-header) | string | Header which each file should have. | no | no |
| [`empty-block`](./RULES_DESCRIPTIONS.md#empty-block) | n/a | Warns on empty code blocks | no | no |
| [`superfluous-else`](./RULES_DESCRIPTIONS.md#superfluous-else) | n/a | Prevents redundant else statements (extends [`indent-error-flow`](./RULES_DESCRIPTIONS.md#indent-error-flow)) | no | no |
| [`confusing-naming`](./RULES_DESCRIPTIONS.md#confusing-naming) | n/a | Warns on methods with names that differ only by capitalization | no | no |
| [`get-return`](./RULES_DESCRIPTIONS.md#get-return) | n/a | Warns on getters that do not yield any result | no | no |
| [`modifies-parameter`](./RULES_DESCRIPTIONS.md#modifies-parameter) | n/a | Warns on assignments to function parameters | no | no |
| [`confusing-results`](./RULES_DESCRIPTIONS.md#confusing-results) | n/a | Suggests to name potentially confusing function results | no | no |
| [`deep-exit`](./RULES_DESCRIPTIONS.md#deep-exit) | n/a | Looks for program exits in funcs other than `main()` or `init()` | no | no |
| [`unused-parameter`](./RULES_DESCRIPTIONS.md#unused-parameter) | n/a | Suggests to rename or remove unused function parameters | no | no |
| [`unreachable-code`](./RULES_DESCRIPTIONS.md#unreachable-code) | n/a | Warns on unreachable code | no | no |
| [`add-constant`](./RULES_DESCRIPTIONS.md#add-constant) | map | Suggests using constant for magic numbers and string literals | no | no |
| [`flag-parameter`](./RULES_DESCRIPTIONS.md#flag-parameter) | n/a | Warns on boolean parameters that create a control coupling | no | no |
| [`unnecessary-stmt`](./RULES_DESCRIPTIONS.md#unnecessary-stmt) | n/a | Suggests removing or simplifying unnecessary statements | no | no |
| [`struct-tag`](./RULES_DESCRIPTIONS.md#struct-tag) | n/a | Checks common struct tags like `json`,`xml`,`yaml` | no | no |
| [`modifies-value-receiver`](./RULES_DESCRIPTIONS.md#modifies-value-receiver) | n/a | Warns on assignments to value-passed method receivers | no | yes |
| [`constant-logical-expr`](./RULES_DESCRIPTIONS.md#constant-logical-expr) | n/a | Warns on constant logical expressions | no | no |
| [`bool-literal-in-expr`](./RULES_DESCRIPTIONS.md#bool-literal-in-expr)| n/a | Suggests removing Boolean literals from logic expressions | no | no |
| [`redefines-builtin-id`](./RULES_DESCRIPTIONS.md#redefines-builtin-id)| n/a | Warns on redefinitions of builtin identifiers | no | no |
| [`function-result-limit`](./RULES_DESCRIPTIONS.md#function-result-limit) | int | Specifies the maximum number of results a function can return | no | no |
| [`imports-blacklist`](./RULES_DESCRIPTIONS.md#imports-blacklist) | []string | Disallows importing the specified packages | no | no |
| [`range-val-in-closure`](./RULES_DESCRIPTIONS.md#range-val-in-closure)| n/a | Warns if range value is used in a closure dispatched as goroutine| no | no |
| [`waitgroup-by-value`](./RULES_DESCRIPTIONS.md#waitgroup-by-value) | n/a | Warns on functions taking sync.WaitGroup as a by-value parameter | no | no |
| [`atomic`](./RULES_DESCRIPTIONS.md#atomic) | n/a | Check for common mistaken usages of the `sync/atomic` package | no | no |
| [`empty-lines`](./RULES_DESCRIPTIONS.md#empty-lines) | n/a | Warns when there are heading or trailing newlines in a block | no | no |
| [`line-lenght-limit`](./RULES_DESCRIPTIONS.md#line-lenght-limit) | int | Specifies the maximum number of characters in a line | no | no |
## Configurable rules

440
RULES_DESCRIPTIONS.md Normal file

@ -0,0 +1,440 @@
# Description of available rules
List of all available rules.
- [Description of available rules](#description-of-available-rules)
- [add-constant](#add-constant)
- [argument-limit](#argument-limit)
- [atomic](#atomic)
- [blank-imports](#blank-imports)
- [bool-literal-in-expr](#bool-literal-in-expr)
- [confusing-naming](#confusing-naming)
- [confusing-results](#confusing-results)
- [constant-logical-expr](#constant-logical-expr)
- [context-as-argument](#context-as-argument)
- [context-keys-type](#context-keys-type)
- [cyclomatic](#cyclomatic)
- [deep-exit](#deep-exit)
- [dot-imports](#dot-imports)
- [empty-block](#empty-block)
- [empty-lines](#empty-lines)
- [error-naming](#error-naming)
- [error-return](#error-return)
- [error-strings](#error-strings)
- [errorf](#errorf)
- [exported](#exported)
- [file-header](#file-header)
- [flag-parameter](#flag-parameter)
- [function-result-limit](#function-result-limit)
- [get-return](#get-return)
- [if-return](#if-return)
- [increment-decrement](#increment-decrement)
- [indent-error-flow](#indent-error-flow)
- [imports-blacklist](#imports-blacklist)
- [line-lenght-limit](#line-lenght-limit)
- [max-public-structs](#max-public-structs)
- [modifies-parameter](#modifies-parameter)
- [modifies-value-receiver](#modifies-value-receiver)
- [package-comments](#package-comments)
- [range](#range)
- [range-val-in-closure](#range-val-in-closure)
- [receiver-naming](#receiver-naming)
- [redefines-builtin-id](#redefines-builtin-id)
- [struct-tag](#struct-tag)
- [superfluous-else](#superfluous-else)
- [time-naming](#time-naming)
- [var-naming](#var-naming)
- [var-declaration](#var-declaration)
- [unexported-return](#unexported-return)
- [unnecessary-stmt](#unnecessary-stmt)
- [unreachable-code](#unreachable-code)
- [unused-parameter](#unused-parameter)
- [waitgroup-by-value](#waitgroup-by-value)
## add-constant
_Description_: Suggests using constant for [magic numbers](https://en.wikipedia.org/wiki/Magic_number_(programming)#Unnamed_numerical_constants) and string literals.
_Configuration_:
* `maxLitCount` : (string) maximum number of instances of a string literal that are tolerated before warn.
* `allowStr`: (string) comma-separated list of allowed string literals
* `allowInts`: (string) comma-separated list of allowed integers
* `allowFloats`: (string) comma-separated list of allowed floats
Example:
```toml
[rule.add-constant]
arguments = [{maxLitCount = "3",allowStrs ="\"\"",allowInts="0,1,2",allowFloats="0.0,0.,1.0,1.,2.0,2."}]
```
## argument-limit
_Description_: Warns when a function receives more parameters than the maximum set by the rule's configuration.
Enforcing a maximum number of parameters helps to keep the code readable and maintainable.
_Configuration_: (int) the maximum number of parameters allowed per function.
Example:
```toml
[argument-limit]
arguments =[4]
```
## atomic
_Description_: Check for commonly mistaken usages of the `sync/atomic` package
_Configuration_: N/A
## blank-imports
_Description_: Blank import should be only in a main or test package, or have a comment justifying it; this rule warns if that is not the case.
_Configuration_: N/A
## bool-literal-in-expr
_Description_: Using Boolean literals (`true`, `false`) in logic expressions may make the code less readable. This rule
suggests removing Boolean literals from logic expressions.
_Configuration_: N/A
## confusing-naming
_Description_: Methods or fields of `struct`s that have similar names may be misleading.
Warns on methods and fields with names that differ only by capitalization.
_Configuration_: N/A
## confusing-results
_Description_: Function or methods that return multiple, no named, values of the same type may induce error. This rule warns on those cases.
_Configuration_: N/A
## constant-logical-expr
_Description_: The rule spots logical expressions that evaluate always to the same value.
_Configuration_: N/A
## context-as-argument
_Description_: Is a language [convention](https://github.com/golang/go/wiki/CodeReviewComments#contexts) that `context.Context` should be the first parameter of a function. This rule spots function declarations that do not follow the convention.
_Configuration_: N/A
## context-keys-type
_Description_: Basic types should not be used as a key in `context.WithValue`.
This rule warns when that is the case.
_Configuration_: N/A
## cyclomatic
_Description_: [Cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) is a measure of code complexity.
Enforcing a maximum complexity per function helps to keep code readable and maintainable.
_Configuration_: (int) the maximum function complexity
Example:
```toml
[cyclomatic]
arguments =[3]
```
## deep-exit
_Description_: Packages exposing functions that can stop program execution by exiting are hard to reuse. This rule looks for program exits in functions other than `main()` or `init()`.
_Configuration_: N/A
## dot-imports
_Description_: Importing with `.` makes the programs much harder to understand because it is unclear where names belong to the current package or to an imported package.
This rule warns when using imports `.`
More information [here](https://github.com/golang/go/wiki/CodeReviewComments#import-dot)
_Configuration_: N/A
## empty-block
_Description_: Empty blocks make code less readable and may be a symptom of a bug or unfinished refactoring. This rule spots empty blocks in the code.
_Configuration_: N/A
## empty-lines
_Description_: Sometimes `gofmt` is not enough to enforce a common formatting of a code-base, this rule warns when there are heading or trailing newlines in code blocks.
_Configuration_: N/A
## error-naming
_Description_: By convention, for the sake of readability, variables holding errors must be named with the prefix `err`. This rule warns when this convention is not followed.
_Configuration_: N/A
## error-return
_Description_: By convention, for the sake of readability, the errors should be last in the list of returned values by a function. This rule warns when this convention is not followed.
_Configuration_: N/A
## error-strings
_Description_: By convention, for better readability, error messages should not be capitalized or end with punctuation or a newline. This rule warns when this convention is not followed.
More information [here](https://github.com/golang/go/wiki/CodeReviewComments#error-strings)
_Configuration_: N/A
## errorf
_Description_: It is possible to get a simpler program by replacing `errors.New(fmt.Sprintf())` with `fmt.Errorf()`. This rule spots that kind of simplification opportunities.
_Configuration_: N/A
## exported
_Description_: Exported function and methods should have comments.
This warns on undocumented exported functions and methods.
More information [here](https://github.com/golang/go/wiki/CodeReviewComments#doc-comments)
_Configuration_: N/A
## file-header
_Description_: This rule helps to enforce a common header for all source files in a project
by spotting those files that do not have the specified header.
_Configuration_: (string) the header to look for in source files.
Example:
```toml
[file-header]
arguments =["This is the text that must appear at the top of source files."]
```
## flag-parameter
_Description_: If a function controls the flow of another by passing it information on what to do, both functions are said to be [control-coupled](https://en.wikipedia.org/wiki/Coupling_(computer_programming)#Procedural_programming).
Coupling among functions must be minimized for better maintainability of the code.
This rule warns on boolean parameters that create a control coupling.
_Configuration_: N/A
## function-result-limit
_Description_: Functions returning too many results can be hard to understand/use.
This rule warns on functions returning more than a configured, maximum number of values.
_Configuration_: (int) the maximum allowed return values
Example:
```toml
[function-result-limit]
arguments =[3]
```
## get-return
_Description_: Typically, functions with names prefixed with _Get_ are supposed to return a value.
_Configuration_: N/A
## if-return
_Description_: Checking if an error is _nil_ to just after return the error or nil is redundant; this rule warns on those cases.
_Configuration_: N/A
## increment-decrement
_Description_: By convention, for better readability, incrementing an integer variable by 1 is recommended to be done using the `++` operator.
This rule spots expressions like `i += 1` and `i -= 1` and proposes to change them into `i++` and `i--`.
_Configuration_: N/A
## indent-error-flow
_Description_: To improve the readability of code, it is recommended to reduce the indentation as much as possible.
This rule highlights redundant _else-blocks_ that can be eliminated from the code.
More information [here](https://github.com/golang/go/wiki/CodeReviewComments#indent-error-flow)
_Configuration_: N/A
## imports-blacklist
_Description_: This rule warns when importing black-listed packages.
_Configuration_: black-list of package names
Example:
```toml
[imports-blacklist]
arguments =["crypto/md5", "crypto/sha1"]
```
## line-lenght-limit
_Description_: This rule warns in the presence of code lines longer than a configured maximum.
_Configuration_: (int) maximum line length in characters.
Example:
```toml
[line-lenght-limit]
arguments =[80]
```
## max-public-structs
_Description_: Packages declaring too many public structs can be hard to understand/use,
and could be a symptom of bad design.
This rule warns on files declaring more than a configured, maximum number of public structs.
_Configuration_: (int) the maximum allowed public structs
Example:
```toml
[max-public-structs]
arguments =[3]
```
## modifies-parameter
_Description_: A function that modifies its parameters can be hard to understand.
It can also be misleading if the arguments are passed by value.
by the caller.
This rule warns when a function modifies one or more of its parameters.
_Configuration_: N/A
## modifies-value-receiver
_Description_: A method that modifies its receiver value can have undesired behavior.
The modification can be also the root of a bug because the actual value receiver may be a copy of that used at the calling site.
This rule warns when a method modifies its receiver.
_Configuration_: N/A
## package-comments
_Description_: Packages should have comments. This rule warns on undocumented
packages and when packages comments are detached to the `package` keyword.
More information [here](https://github.com/golang/go/wiki/CodeReviewComments#package-comments)
_Configuration_: N/A
## range
_Description_: This rule suggests a shorter way of writing ranges that do not use the second value.
_Configuration_: N/A
## range-val-in-closure
_Description_: Range variables in a loop are reused at each iteration; therefore a goroutine created in a loop will point to the range variable with from the upper scope. This way, the goroutine may use the variable with an undesired value.
This rule warns when a range value (or index) is used inside a closure
_Configuration_: N/A
## receiver-naming
_Description_: By convention, receiver names in a method should reflect their identity.
For example, if the receiver is of type `Parts`, `p` is an adequate name for it.
Contrary to other languages, it is not idiomatic to name receivers as `this` or `self`.
This rule warns when a receiver has a name, not in line with this convention.
_Configuration_: N/A
## redefines-builtin-id
_Description_: Constant names like `false`, `true`, `nil`, function names like
`append`, `make`, and basic type names like `bool`, and `byte` are not reserved words of the
language; therefore the can be redefined.
Even if possible, redefining these built in names can lead to bugs very difficult to detect.
This rule, warns when a built-in identifier is redefined.
_Configuration_: N/A
## struct-tag
_Description_: Struct tags are not checked at compile time.
This rule, checks and warns if it founds errors in common struct tags types like: asn1, default, json, protobuf, xml, yaml.
_Configuration_: N/A
## superfluous-else
_Description_: To improve the readability of code, it is recommended to reduce the indentation as minimal as possible.
This rule highlights redundant _else-blocks_ that can be eliminated from the code.
_Configuration_: N/A
## time-naming
_Description_: Using unit-specific suffix like "Secs", "Mins", ... when naming variables of type `time.Duration` can be misleading, this rule highlights those cases.
_Configuration_: N/A
## var-naming
_Description_: This rule warns when [variable](https://github.com/golang/go/wiki/CodeReviewComments#variable-names) or [package](https://github.com/golang/go/wiki/CodeReviewComments#package-names) naming conventions are not followed.
_Configuration_: This rule accepts two slices of strings, a whitelist and a blacklist of initialisms. By default, the rule behaves exactly as the alternative in `golint` but optionally, you can relax it (see [golint/lint/issues/89](https://github.com/golang/lint/issues/89))
Example:
```toml
[rule.var-naming]
arguments = [["ID"], ["VM"]]
```
## var-declaration
_Description_: This rule proposes simplifications of variable declarations.
_Configuration_: N/A
## unexported-return
_Description_: This rule warns when an exported function or method returns a value of an un-exported type.
_Configuration_: N/A
## unnecessary-stmt
_Description_: To improve the readability of code, this rule suggests to remove redundant statements like a `break` at the end of a case block.
_Configuration_: N/A
## unreachable-code
_Description_: This rule spots and proposes to remove [unreachable code](https://en.wikipedia.org/wiki/Unreachable_code).
_Configuration_: N/A
## unused-parameter
_Description_: This rule warns on unused parameters. Functions or methods with unused parameters can be a symptom of an unfinished refactoring or a bug.
_Configuration_: N/A
## waitgroup-by-value
_Description_: Function parameters that are passed by value, are in fact a copy of the original argument.
Passing a copy of a `sync.WaitGroup` is usually not what the developer wants to do.
This rule warns when a `sync.WaitGroup` expected as a by-value parameter in a function or method.
_Configuration_: N/A