1
0
mirror of https://github.com/mgechev/revive.git synced 2025-02-11 13:38:40 +02:00

adds identical-branches to doc

This commit is contained in:
chavacava 2020-05-08 22:21:34 +02:00
parent fb92af247c
commit b43b33a4e6
2 changed files with 9 additions and 0 deletions

View File

@ -350,6 +350,8 @@ List of all available rules. The rules ported from `golint` are left unchanged a
| [`cognitive-complexity`](./RULES_DESCRIPTIONS.md#cognitive-complexity) | int | Sets restriction for maximum Cognitive complexity. | no | no |
| [`string-of-int`](./RULES_DESCRIPTIONS.md#string-of-int) | n/a | Warns on suspicious casts from int to string | no | yes |
| [`early-return`](./RULES_DESCRIPTIONS.md#early-return) | n/a | Spots if-then-else statements that can be refactored to simplify code reading | no | no |
| [`identical-branches`](./RULES_DESCRIPTIONS.md#identical-branches) | n/a | Spots if-then-else statements with identical `then` and `else` branches | no | no |
## Configurable rules
Here you can find how you can configure some of the existing rules:

View File

@ -33,6 +33,7 @@ List of all available rules.
- [flag-parameter](#flag-parameter)
- [function-result-limit](#function-result-limit)
- [get-return](#get-return)
- [identical-branches](#identical-branches)
- [if-return](#if-return)
- [increment-decrement](#increment-decrement)
- [indent-error-flow](#indent-error-flow)
@ -313,6 +314,12 @@ _Description_: Typically, functions with names prefixed with _Get_ are supposed
_Configuration_: N/A
## identical-branches
_Description_: an `if-then-else` conditional with identical implementations in both branches is an error.
_Configuration_: N/A
## if-return
_Description_: Checking if an error is _nil_ to just after return the error or nil is redundant.