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

28 Commits

Author SHA1 Message Date
Oleksandr Redko
f4976873e7 docs: improve comments for functions; enable godot (#1382) 2025-05-27 07:44:24 +02:00
Oleksandr Redko
6d0498cb97 refactor: simplify File.disabledIntervals, add tests (#1216) 2025-03-07 06:18:24 +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
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
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
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
Oleksandr Redko
0afba4ff15 refactor: enforce map and slice style (#1131) 2024-11-16 18:05:30 +01:00
Oleksandr Redko
74e2417f7d fix: revive hangs on Windows if go.mod is not found 2024-11-15 09:37:53 +01:00
Oleksandr Redko
4c958ef739 refactor: remove redundant defer 2024-11-12 09:26:30 +01:00
centralab
c0d4d07ab6 fix: nil panic on old go.mod (issue #1100) 2024-11-11 18:50:12 +01:00
Oleksandr Redko
662e02cd70 refactor: use "filepath" instead of "path" (#1073) 2024-10-25 11:48:41 +02:00
chavacava
251470be6a use a default Go version (1.0) in absence of go.mod (#1028) 2024-08-18 19:21:50 +02:00
chavacava
56702bd8d7 extract go version without depending on go list (#1025)
* extract go version without depending on go list

---------

Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-08-18 09:53:45 +02:00
dominiquelefevre
0df1bb0860 Fix a performance regression #995 (#998)
* Support go workspaces when detecting the go version.

When a module is part of a workspace, a call to `go list -m` lists all
modules in the workspace, and we need to parse multiple modinfos.

* Do not invoke `go list` for every package.

* Add a go language version override config option for golangci-lint.
2024-06-22 17:12:49 +02:00
dominiquelefevre
4242f24f4d Add support for the new implementation of for loop variables in go 1.22. (#993)
* Add support for the new behaviour of for loops in go 1.22.

Go 1.22 has changed the behaviour of for loops. Every iteration
makes new loop variables. It is now safe to take their addresses
because they are guaranteed to be unique. Similarly, it is now
safe to capture loop variables in functions.

* adds documentation for public function

---------

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2024-06-02 11:55:26 +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
chavacava
e0fa03a13a Max open files (#628)
* adds max_open_files flag

* adds doc of max_open_files flag

* amends commmit
2022-02-07 17:36:03 -08:00
doniacld
9c30b4479c Run revive over a invalid go source file (#364) (#598) 2021-10-17 19:58:29 +02:00
mgechev
1686f0b237 Introduce optional type checking
Enable optional type checking.
2018-05-31 21:43:02 -07:00
mgechev
64636caedd Fix package level type checking 2018-05-31 19:49:39 -07:00
mgechev
deb72d6238 Add default formatter 2018-01-27 17:01:18 -08:00
mgechev
1870854374 Improvements 2018-01-27 16:37:30 -08:00
mgechev
f926547659 Refactoring 2018-01-24 15:44:03 -08:00