1
0
mirror of https://github.com/mgechev/revive.git synced 2025-10-30 23:37:49 +02:00

21 Commits

Author SHA1 Message Date
chavacava
cf4901574e refactor: replaces calls to astutils.PickNodes with calls to astutils.SeekNode when possible (#1482) 2025-08-23 17:41:10 +02:00
chavacava
68ac5514f5 feature: detect identical-branches in switch statements (#1448) 2025-07-30 15:55:03 +02:00
Asaf Krenzler
cc180e221e var-naming: option to skip initialism name checks (#1415)
Co-authored-by: akrenzler <akrenzler@paloaltonetworks@com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-07-11 04:45:38 -07:00
Oleksandr Redko
77d0d4a54b early-return: detect short deviated statements (#1396) 2025-06-25 13:51:18 +02:00
Oleksandr Redko
f4976873e7 docs: improve comments for functions; enable godot (#1382) 2025-05-27 07:44:24 +02:00
chavacava
92f28cb5e1 refactor: moves code related to AST from rule.utils into astutils package (#1380)
Modifications summary:

* Moves AST-related functions from rule/utils.go to astutils/ast_utils.go (+ modifies function calls)
* Renames some of these AST-related functions
* Avoids instantiating a printer config at each call to astutils.GoFmt
* Uses astutils.IsIdent and astutils.IsPkgDotName when possible
2025-05-26 13:18:38 +02:00
chavacava
51ac5c2524 feature: new rule unnecessary-format to spot unnecessary use of formatting functions (#1372) 2025-05-26 11:07:42 +02:00
Oleksandr Redko
906dcefddb chore: remove redundant typeparams for Go 1.17 (#1331) 2025-05-01 02:44:38 -07:00
Oleksandr Redko
a5e5d78760 chore: enable a few revive rules (#1330) 2025-05-01 02:40:29 -07:00
chavacava
dbcfd66945 fix(1323): false positive in get-return rule for HTTP Get handlers (#1325) 2025-04-27 13:06:29 +02:00
Oleksandr Redko
9f5f957b33 rule: allow lowercased and kebab-cased options (#1272)
* rule: tests for Configure with named options; fix errors

* rule: refactor and add tests for ifelse rules

* rule: allow lowercased and kebab-cased options

* test: update integration tests with lowercased params

* docs: update rules descriptions

* rule: simplify Configure implementation with one option

* gofmt and fix lint

* review: add isRuleOption, update grammar in doc, simplify regex

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>

---------

Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
2025-03-28 09:34:20 +01:00
Ludovic Fernandez
9a54195228 fix: panic with getFieldTypeName (#1229)
* fix: panic with interface type and array

* replaces panic with a return of a default string

* review

---------

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2025-02-12 14:10:48 +01:00
chavacava
fd8d99d716 fix (1217): getting parameter type names panics in presence of generic types (#1218) 2025-02-04 12:26:17 +01:00
ccoVeille
d64bddc9bc chore: use US English instead of UK English (#1186) 2024-12-12 14:13:45 +01:00
chavacava
24a9325b5a fix: ast_utils.FuncSignatureIs panics with types names other than ast.Ident (#1174) 2024-12-07 15:40:39 +01:00
chavacava
06192a5599 refactor: remove lint issues (#1176) 2024-12-07 14:43:25 +01:00
Denis Voytyuk
cb74ccbf44 chore: Improve sortables detection (#1151)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-12-02 13:02:39 +01:00
Miles Delahunty
7e1d35d8d2 feat: optional extension to early-return rule (#1133) (#1138) 2024-11-28 08:51:33 +01:00
Miles Delahunty
ae07914dc4 ifelse: option to preserve variable scope (#832)
* ifelse: option to preserve variable scope
2023-05-23 10:10:09 +02:00
Miles Delahunty
4bb48df5d2 refactor: extract shared code for linting if-else chains (#821)
* refactor: extract shared code for linting if-else chains

The rules "early-return", "indent-error-flow" and
"superfluous-else" have a similar structure. This
moves the common logic for classifying if-else chains
to a common package.

A few side benefits:
- "early-return" now handles os.Exit/log.Panicf/etc
- "superfluous-else" now handles (builtin) panic
- "superfluous-else" and "indent-error-flow" now handle if/else
  chains with 2+ "if" branches

* internal/ifelse: style fixes, renames, spelling
2023-05-17 13:51:35 +02:00
Ivan Trubach
dc30eb1182 fix(receiver-naming): distinguish types with parameters (#692)
* fix(receiver-naming): distinguish types with parameters

* chore: run tests using supported Go versions matrix
2022-06-18 18:47:53 +02:00