1
0
mirror of https://github.com/mgechev/revive.git synced 2025-06-02 22:57:22 +02:00

1101 Commits

Author SHA1 Message Date
chavacava
3cf67c5783
feature: add support of URL struct tags in struct-tag rule (#1239) 2025-02-17 07:18:30 +01:00
chavacava
8ece20b078
feature: add support for omitzero in rule struct-tag (#1238) v1.7.0 2025-02-16 11:31:17 +01:00
renovate[bot]
a59a2288fd
chore(deps): update golang docker tag to v1.24 (#1232)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-13 17:07:22 +01:00
chavacava
4020f4387e
fix: exclusions are no longer working as before (#1237)
* fix: exclusions are no longer working as before (fixed by reverting #1060)

* removes failing test on main.GetVersion
2025-02-13 14:38:55 +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>
v1.6.1
2025-02-12 14:10:48 +01:00
renovate[bot]
3e3e9825db
fix(deps): update module golang.org/x/tools to v0.30.0 (#1227) 2025-02-11 17:10:03 +01:00
renovate[bot]
82dd1920b0
chore(deps): update module golang.org/x/sys to v0.30.0 (#1224)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 20:56:31 +01:00
renovate[bot]
f66fd1eb75
chore(deps): update module golang.org/x/text to v0.22.0 (#1225)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 20:52:16 +01:00
renovate[bot]
d04f429918
fix(deps): update module golang.org/x/sync to v0.11.0 (#1220)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:59:36 +01:00
renovate[bot]
ea0222b242
fix(deps): update module golang.org/x/mod to v0.23.0 (#1219)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:53:48 +01:00
renovate[bot]
3b54068168
chore(deps): update module github.com/stretchr/testify to v1.10.0 (#1223)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:49:47 +01:00
renovate[bot]
d02fd30f5c
chore(deps): update module github.com/mattn/go-colorable to v0.1.14 (#1222)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:49:27 +01:00
Denis Voytyuk
c237f70575
Update renovate.json config (#1221) 2025-02-04 19:45:32 +01:00
Marcin Federowicz
e8b55f8917
prepareSkips: to resolve regexps in excludes (#1060)
* prepareSkips: to resolve regexps in excludes

* prepareSkips: to resolve regexps in excludes

* cleanup

* errorf: format

* doublestar/v4: latest version
2025-02-04 19:17:59 +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
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