1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00
Commit Graph

1136 Commits

Author SHA1 Message Date
Oleksandr Redko
a34327e65c chore: check go.mod and run gofmt in CI (#1215) 2025-01-29 18:11:05 +01:00
chavacava
4bd6fbac97 fix: unconditional-recursion false positive when the function is called right after its declaration (#1212) (#1214) 2025-01-29 17:24:22 +01:00
Semih Buyukgungor
5f01efa722 feature: add redundant-test-main-exit rule (#1208) 2025-01-29 14:36:00 +01:00
chavacava
8c5d8fc90a fix: flag-parameter rule wrongly detects var definition and points to the function signature (#1213) 2025-01-28 14:53:32 +01:00
Oleksandr Redko
a600be2470 docs: fix TOC in README (#1210) 2025-01-28 11:32:05 +01:00
ccoVeille
8cb2599624 fix: invalid message reported for directive comment (#1209)
They were invalid but not reported with the correct message.

So they were wrongly caught by golangci-lint that excluded them by default.
2025-01-27 07:12:16 +01:00
Oleksandr Redko
d9c61c1518 fix: running revive in CI (#1205)
* fix: running revive in CI

* fix line-length-limit issue
v1.6.0
2025-01-23 09:17:24 +01:00
Marcin Federowicz
111737201e update doc (#1203)
* update doc

* review updates

* review updates
2025-01-23 09:15:44 +01:00
Oleksandr Redko
77616f0d30 refactor: fix 'use-any' revive issues (#1204) 2025-01-22 16:45:41 +01:00
Denis Voytyuk
7d97f5481a [chore] clean up go.sum (#1201) 2025-01-21 17:38:21 +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
renovate[bot]
57fe5b63d4 fix(deps): update module github.com/spf13/afero to v1.12.0 (#1200)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-18 12:15:20 +01:00
Oleksandr Redko
63afe4af77 docs: update "Text Editors" section (#1199)
* docs: update "Text Editors" section

* Fix VSCode setting name
2025-01-10 09:06:41 +01:00
renovate[bot]
4ba2c562ed fix(deps): update module golang.org/x/tools to v0.29.0 (#1198)
* fix(deps): update module golang.org/x/tools to v0.29.0

* Fix go.sum

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Denis Voytyuk <5462781+denisvmedia@users.noreply.github.com>
2025-01-08 19:44:06 +01:00
Denis Voytyuk
4b2c76e8b9 chore: cleanup code in rules (#1197) 2024-12-31 12:33:51 +01:00
Oleksandr Redko
4ca2c11e87 refactor: get rid of mitchellh/go-homedir package (#1195) 2024-12-24 15:34:17 +01:00
Oleksandr Redko
7998011cac fix: return configure rule error (#1193) 2024-12-23 15:10:21 +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
Oleksandr Redko
7cbd3d117a refactor: use slices.SortFunc instead of sort.Slice (#1191) 2024-12-13 18:57:34 +01:00
Oleksandr Redko
cadb2dd008 refactor: simplify config.GetFormatter; add tests (#1184) 2024-12-13 13:57:50 +01:00
Markus Wiegand
45731a378c chore: migrate goreleaser config to v2 (#1105) 2024-12-13 11:43:04 +01:00
Oleksandr Redko
78e927d8c7 refactor: simplify by using switch instead of if (#1190) 2024-12-12 17:42:09 +01:00
ccoVeille
d64bddc9bc chore: use US English instead of UK English (#1186) 2024-12-12 14:13:45 +01:00
ccoVeille
3421eaecf0 refactor: fix linting issues (#1188)
* refactor: fix thelper issues

test/utils_test.go:19:6   thelper  test helper function should start from t.Helper()
test/utils_test.go:42:6   thelper  test helper function should start from t.Helper()
test/utils_test.go:63:6   thelper  test helper function should start from t.Helper()
test/utils_test.go:146:6  thelper  test helper function should start from t.Helper()

* refactor: fix govet issues

rule/error_strings.go:50:21  govet  printf: non-constant format string in call to fmt.Errorf

* refactor: fix gosimple issue

rule/bare_return.go:52:9  gosimple  S1016: should convert w (type lintBareReturnRule) to bareReturnFinder instead of using struct literal

* refactor: fix errorlint issues

lint/filefilter.go:70:86    errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
lint/filefilter.go:113:104  errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
lint/filefilter.go:125:89   errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
lint/linter.go:166:72       errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
lint/linter.go:171:73       errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
config/config.go:174:57     errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
config/config.go:179:64     errorlint  non-wrapping format verb for fmt.Errorf. Use `%w` to format errors

* refactor: fix revive issue about comment spacing

cli/main.go:31:2 revive comment-spacings: no space between comment delimiter and comment text

* refactor: fix revive issue about unused-receiver

revivelib/core_test.go:77:7                     revive       unused-receiver: method receiver 'r' is not referenced in method's body, consider removing or renaming it as _
revivelib/core_test.go:81:7                     revive       unused-receiver: method receiver 'r' is not referenced in method's body, consider removing or renaming it as _
rule/context_as_argument.go:76:7                revive       unused-receiver: method receiver 'r' is not referenced in method's body, consider removing or renaming it as _
rule/var_naming.go:73:7                         revive       unused-receiver: method receiver 'r' is not referenced in method's body, consider removing or renaming it as _
rule/modifies_value_receiver.go:59:7            revive       unused-receiver: method receiver 'r' is not referenced in method's body, consider removing or renaming it as _
rule/filename_format.go:43:7                    revive       unused-receiver: method receiver 'r' is not referenced in method's body, consider removing or renaming it as _

* refactor: fix revive issues about unused-parameter

revivelib/core_test.go:81:24                    revive       unused-parameter: parameter 'file' seems to be unused, consider removing or renaming it as _
revivelib/core_test.go:81:41                    revive       unused-parameter: parameter 'arguments' seems to be unused, consider removing or renaming it as _

* refactor: fix gocritic issues about commentedOutCode

test/utils_test.go:119:5                       gocritic  commentedOutCode: may want to remove commented-out code
rule/unreachable_code.go:65:3                  gocritic  commentedOutCode: may want to remove commented-out code
2024-12-12 08:42:41 +01:00
ccoVeille
4dd63ef035 chore: fix typo (#1187) 2024-12-12 08: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
10d9697cc2 chore: remove unused #region comments (#1181) 2024-12-09 17:15:12 +01:00
chavacava
f94c9d75db refactor: add all wait group delta at once when possible (#1179) 2024-12-08 16:59:52 +01:00
chavacava
e23fcdb498 refactor: modifies linting machinery to use Failure as a mean to signal erros in rules application (#1178) 2024-12-08 15:56:14 +01:00
chavacava
f6a38208af refactor: code cleanup (#1177) 2024-12-08 11:08:54 +01:00
chavacava
5c2aadfa91 refactor (rule/receiver-naming): replace AST walker by iteration over declarations (#1169)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-12-07 23:04:31 +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
chavacava
a106e63fb8 fix(rule/modifies-value-receiver): miss modification by ++/-- (#1175) 2024-12-07 13:17:15 +01:00
chavacava
3e1dbc033e refactor (rule/get-return): replace AST walker by iteration over declarations (#1168) 2024-12-07 12:06:10 +01:00
chavacava
cb89a4cc78 refactor (rule/datarace): replace AST walker by iteration over declarations (#1162) 2024-12-07 11:49:13 +01:00
chavacava
8f540123a1 refactor (rule/unused-receiver): replace AST walker by iteration over declarations (#1171) 2024-12-05 13:09:31 +01:00
chavacava
278246df68 refactor (rule/unexported-return): replace AST walker by iteration over declarations (#1170) 2024-12-05 13:09:07 +01:00
renovate[bot]
47dc9238d1 fix(deps): update module golang.org/x/tools to v0.28.0 (#1172)
* fix(deps): update module golang.org/x/tools to v0.28.0

* clean up go.sum

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Denis Voytyuk <5462781+denisvmedia@users.noreply.github.com>
2024-12-05 13:03:12 +01:00
Oleksandr Redko
c160d12fd3 test: remove useless comments (#1173) 2024-12-05 13:01:47 +01:00
chavacava
a31d590c83 refactor (rule/function-result-limit): replace AST walker by iteration over declarations (#1167) 2024-12-04 21:13:35 +01:00
chavacava
a31d5afbcd refactor (rule/modifies-value-receiver): replace AST walker by iteration over declarations (#1165) 2024-12-04 21:02:58 +01:00
chavacava
361c74464d refactor (rule/function-length): replace AST walker by iteration over declarations (#1166) 2024-12-04 20:58:43 +01:00
chavacava
fcfd6ad5f1 refactor (rule/flag-param): replace AST walker by iteration over declarations (#1164) 2024-12-04 20:55:01 +01:00
chavacava
9a5c95f1cf refactor(rule/context-as-argument): replace AST walker by iteration over declarations (#1160) 2024-12-04 20:54:09 +01:00
chavacava
c3b541ff73 refactor (rule/arguments-limits): replace AST walker by iteration over declarations (#1159) 2024-12-04 20:53:35 +01:00
chavacava
275b0184e2 refactor (rule/error-return): replace AST walker by iteration over declarations (#1163)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-12-04 17:43:00 +01:00
chavacava
4b137822ea refactor (rule/cyclomatic): replace AST walker by iteration over declarations (#1161)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-12-04 17:42:29 +01:00
chavacava
98a6c97664 fix: confusing-results doesn't work with pointer types (#1158)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-12-04 17:42:07 +01:00
Oleksandr Redko
09fb350a27 unused-param,unused-receiver: refactor configure func (#1157) 2024-12-04 05:55:19 +01:00