1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00
Commit Graph

19 Commits

Author SHA1 Message Date
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
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
Oleksandr Redko
395f7902d3 refactor: replace failure Category raw string with constant (#1196)
* refactor: replace Category raw strings with constants

* Add type FailureCategory; add comments for constants
2025-01-18 12:16:19 +01:00
ccoVeille
3d1115dacd refactor: rule configuration and error management (#1185)
* refactor: avoid running rule once configuration failed

* refactor: remove deep-exit in lint/linter.go
2024-12-13 21:38:46 +01:00
Marcin Federowicz
9b15f3fcb6 refactor: replace panic with error in rules (#1126)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2024-12-11 19:35:58 +01:00
Oleksandr Redko
d181862481 docs: fix rule descriptions (#1147) 2024-12-01 16:44:41 +01:00
Oleksandr Redko
3378f7033b refactor: replace mutex with sync.Once for rule configuration (#1118) 2024-11-15 12:03:59 +01:00
chavacava
ca2a32b087 code cleanup (#1054) 2024-10-01 12:14:02 +02:00
chavacava
6a139caf92 fix #1029 (#1030) 2024-08-21 10:38:34 +02:00
Marcin Federowicz
36c2ee2718 code cleanup: replace interface{} with any (#906) 2023-09-24 08:44:02 +02:00
chavacava
5ccebe86c2 Code cleaunp (#905)
* fix minor lint issue

* fix package comments

* fix comments

* removes extra empty lines

* fix import alias name
2023-09-23 10:41:34 +02:00
chavacava
9acfcc8f86 fix #863:false positive on return statement in a func lit passed to the deferred function (#870) 2023-08-18 11:21:42 -07:00
Steven L
db56db0b6a Capture yet more bad defer / recover patterns (#719)
* Yet more bad defer / recover patterns

`recover()` is an eternal font of excitement.

* demonstrating another flavor of failure

* removing leftover code

* update documentation

* removes test not related to the rule itself

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-07-24 09:34:16 +02:00
chavacava
04728cf0de Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
chavacava
31fbdb1833 Fix/677 (#678) 2022-04-10 09:06:59 +02:00
subham sarkar
577441d60c format sources w/ gofumpt (#643)
Signed-off-by: subham sarkar <sarkar.subhams2@gmail.com>
2022-03-02 08:24:55 +01:00
SalvadorC
2c895fb33f Code cleanup (#606) 2021-10-23 13:25:41 +02:00
SalvadorC
76b8c57329 Memoization of rule arguments (#595) 2021-10-17 20:34:48 +02:00
chavacava
ad3100c9ec adds defer rule 2020-06-08 09:40:38 -07:00