1
0
mirror of https://github.com/mgechev/revive.git synced 2025-05-31 22:49:41 +02:00

164 Commits

Author SHA1 Message Date
Oleksandr Redko
724a4ca419
chore: remove redundant //revive:disable-line (#1335) 2025-05-02 02:02:31 -07:00
Oleksandr Redko
906dcefddb
chore: remove redundant typeparams for Go 1.17 (#1331) 2025-05-01 02:44:38 -07:00
Marcin Federowicz
7ba6ad4fcd
var-naming: remove regex from code (#1322)
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-04-25 01:32:03 -07:00
chavacava
d8a47ba18e
var-name checks each package name only once (#1319) 2025-04-24 14:29:39 +02:00
Oleksandr Redko
558580268e
var-naming: detect meaningless package names (#1312) 2025-04-16 02:30:28 -07:00
Semih Buyukgungor
c882cb8f4f
exported: correctly report deprecation-only comments (#1295) 2025-04-06 12:59:04 +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
chavacava
88d5434cee
feature: add support for TOML struct tags in struct-tag rule (#1255) 2025-03-03 13:19:40 +01:00
Oleksandr Redko
77f4474cab
refactor: string-format implements ConfigurableRule (#1251) 2025-02-26 22:26:21 +01:00
Oleksandr Redko
67d0a61a1b
fix: error-strings custom funcs overwrites defaults (#1249) 2025-02-26 22:16:06 +01:00
chavacava
3bbfedbf43
feature: add suport of validate struct tags in struct-tag rule (#1244) 2025-02-20 19:48:35 +01:00
chavacava
4f342352f0
feature: add suport of mapstructure struct tags in struct-tag rule (#1241) 2025-02-19 14:30:29 +01:00
chavacava
a4ee892836
feature: add support of datastore struct tags in struct-tag rume (#1240) 2025-02-18 13:09:31 +01:00
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) 2025-02-16 11:31:17 +01:00
Semih Buyukgungor
5f01efa722
feature: add redundant-test-main-exit rule (#1208) 2025-01-29 14:36:00 +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
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
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
Oleksandr Redko
c160d12fd3
test: remove useless comments (#1173) 2024-12-05 13:01:47 +01:00
chavacava
c3b541ff73
refactor (rule/arguments-limits): replace AST walker by iteration over declarations (#1159) 2024-12-04 20:53:35 +01:00
Oleksandr Redko
09fb350a27
unused-param,unused-receiver: refactor configure func (#1157) 2024-12-04 05:55:19 +01:00
Miles Delahunty
7e1d35d8d2
feat: optional extension to early-return rule (#1133) (#1138) 2024-11-28 08:51:33 +01:00
chavacava
d2778f36f1
adds rule use-errors-new (#1142)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-11-22 08:22:51 +01:00
Oleksandr Redko
7f769f8c16
feat: add redundant-build-tag rule (#1135) 2024-11-20 20:26:28 +01:00
Oleksandr Redko
19834d40a4
test: add default case when no arguments provided to a rule (#1140) 2024-11-20 20:19:17 +01:00
Oleksandr Redko
d81fc8fab3
refactor: reduce control nesting in AddConstantRule.configure (#1128) 2024-11-18 14:38:56 +01:00
Oleksandr Redko
0afba4ff15
refactor: enforce map and slice style (#1131) 2024-11-16 18:05:30 +01:00
chavacava
7ee4500e12
fix: fixes #1103 by fixing the processing of max-public-structs arguments (#1114) 2024-11-15 09:43:53 +01:00
Oleksandr Redko
be95bfa705 refactor: rename files to follow Go convention 2024-11-11 19:31:18 +01:00
centralab
c0d4d07ab6 fix: nil panic on old go.mod (issue #1100) 2024-11-11 18:50:12 +01:00
Oleksandr Redko
6228ba57cf
refactor: simplify tests (#1089) 2024-11-04 09:25:03 -03:00
chavacava
7c068a7dde
fix duplicated findings for string-format when there is more than one… (#1085) 2024-11-04 09:19:29 -03:00
Oleksandr Redko
9a8587cc49
revive: add revive.toml for linting revive itself (#1094) 2024-11-04 09:18:17 -03:00
chavacava
eb18252088
adds filename-format rule (#1092) 2024-11-02 14:23:46 -03:00
Oleksandr Redko
511e4e65ff
fix: extractInstructionFromJSON returns an error (#1082) 2024-10-29 13:33:38 +01:00
Oleksandr Redko
7c29b560c3
refactor: fix typo in the field name of TestFileFilterRule (#1086) 2024-10-29 13:33:18 +01:00
Oleksandr Redko
14babf2824
refactor: move lint.Name to name.go file (#1084) 2024-10-28 13:22:36 +01:00
Oleksandr Redko
d29323985f
refactor: add tests for isGenerated in the lint package (#1083) 2024-10-28 08:24:10 -03:00
Oleksandr Redko
3bead6f4a0
feat: add file-length-limit rule (#1072) 2024-10-26 07:40:24 -03:00
Oleksandr Redko
599874c773
chore: remove unnecessary empty lines (#1080) 2024-10-26 07:35:02 -03:00
Oleksandr Redko
662e02cd70
refactor: use "filepath" instead of "path" (#1073) 2024-10-25 11:48:41 +02:00
Marcin Federowicz
ff7b0adb4c
rule.exported: add feature to disable checking on const,method,function, variable (#1047)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2024-10-02 10:46:52 +02:00
chavacava
53a111d36e
adds check for receiver names length (#1048)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
Co-authored-by: yuta nishiyama <57400690+ytnsym@users.noreply.github.com>
2024-09-23 12:38:39 +02:00
chavacava
a65fb8d1b5
adds tests for specific go versions (#1043)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-09-20 16:09:24 +02:00
Oleksandr Redko
59131927d3
Move away from deprecated github.com/pkg/errors (#1039) 2024-09-16 09:40:46 +02:00
Oleksandr Redko
8bea739f45
docs: fix typo in comments (#1037) 2024-09-14 21:38:06 +02:00
Trifun
a638ed6e24
Add multiple scopes support to string-format rule (#1009)
* Add multiple scopes support to string-format rule

* Add new parsing rule

* Fix example
2024-08-09 21:01:17 +02:00
Fagim Sadykov
8f9edc9fe7
#1002 - add "checkPublicInterface" option to "exported" rule to allow check documentation on public methods on public interfaces (#1003)
* [var-naming] handle private uppercased const

* FEATURE #1002 - "checkPublicInterface" option for "exported" rule - to check public interface method comments

* fix exported #1002 for ast.Ident

* fix exported #1002 for ast.Ident 2

* go fmt applyed

* #1002 update documentation on `exported` rule

* refactor `exported` rule configuration logic

* test and review fixes

---------

Co-authored-by: fregin <freginpanklinshtern@gmail.com>
2024-07-30 10:36:03 +02:00
Songlin Yang
7ef710a0c2
fix(1007): return Sel.Name as FuncName when selector is an CallExpr (#1012)
Signed-off-by: lsytj0413 <511121939@qq.com>
2024-07-19 10:33:27 +02:00