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

25 Commits

Author SHA1 Message Date
Godsgift Uloamaka Ebite
1bc57ac6f3 feature(deep-exit): detect exit-triggering flag usage (#1544) 2025-10-23 16:17:59 +02:00
Oleksandr Redko
809768cffe chore: enable formatters in golangci-lint config (#1421) 2025-07-12 07:32:39 -07:00
Oleksandr Redko
f4976873e7 docs: improve comments for functions; enable godot (#1382) 2025-05-27 07:44:24 +02:00
ccoVeille
a3338de10b chore: enable thelper linter in golangci-lint (#1386)
It allows us to report errors at the right place in the tests.

There was only one function that was not using the helper.
It has been fixed to use it.
2025-05-27 07:41:11 +02:00
Oleksandr Redko
e8ed573739 refactor: enable gocritic linter; fix lint issues (#1375) 2025-05-26 02:40:17 -07:00
chavacava
94cd7bdec2 refactor: removes get from getters names (#1373) 2025-05-24 19:03:05 +02:00
Oleksandr Redko
a5e5d78760 chore: enable a few revive rules (#1330) 2025-05-01 02:40:29 -07:00
Oleksandr Redko
7b2c7e74fc test: split TestGetVersion; remove toolchain (#1303) 2025-04-10 07:54:40 +02:00
Oleksandr Redko
1cb97fdcfc refactor: fix typos in comments and struct names (#1304) 2025-04-10 07:47:55 +02:00
Oleksandr Redko
9177f5044a test: re-enable and fix test case for getVersion (#1246) 2025-02-21 17:33:13 +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
Semih Buyukgungor
5f01efa722 feature: add redundant-test-main-exit rule (#1208) 2025-01-29 14:36:00 +01:00
Oleksandr Redko
4ca2c11e87 refactor: get rid of mitchellh/go-homedir package (#1195) 2024-12-24 15:34:17 +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
chavacava
f6a38208af refactor: code cleanup (#1177) 2024-12-08 11:08:54 +01:00
Oleksandr Redko
1425e2f44c refactor: simplify with strings.Prefix, strings.CutPrefix (#1137) 2024-11-19 15:43:04 +01:00
Oleksandr Redko
93c6bc8636 refactor: extract getVersion function (#1127)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-11-18 14:45:28 +01:00
Oleksandr Redko
ce6965265a fix: cli tests on Windows; add tests-on-windows workflow 2024-11-15 09:39:39 +01:00
Oleksandr Redko
78c3a6c363 chore: enable test shuffle and fix TestXDGConfigDirNoFile 2024-11-07 09:00:51 -03:00
Oleksandr Redko
599874c773 chore: remove unnecessary empty lines (#1080) 2024-10-26 07:35:02 -03:00
Oleksandr Redko
29ba247979 cli: refactor tests: use TestMain, t.Setenv (#931) 2023-11-02 17:07:46 +01:00
Marcin Federowicz
cd2737acb4 Load config from different locations prefer XDG_CONFIG_HOME before HOME (#912) 2023-10-03 20:07:00 +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
Bernardo Heynemann
318db94210 Separating lib from cli (#655)
* Separating lib from cli

* Renamed NewRevive to New

* Added GetLintFailures helper function

* Moved formatter to call to format since that's when it's needed

* makes fields of Revive struct non-public

* minor modifs in tests: remove unnamed constats

* Added lint package management to lint command

* README message for using revive as a library

* README formatting

* Removed unused method

* Slightly improved wording in README

* Handling format errors

* Renaming file to better reflect intent

* Refactoring pattern usage

* README heads

* renames excludePaths into excludePatterns

Co-authored-by: Bernardo Heynemann <bernardo.heynemann@coinbase.com>
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-03-29 17:31:52 +02:00
Bernardo Heynemann
1c283837a9 Allow revive to be called with extra linters (#650)
This change allows revive to be called from main.go
in other libraries and pass in a list of custom
linters to be added to the built-in linters found in config

Co-authored-by: Bernardo Heynemann <bernardo.heynemann@coinbase.com>
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-03-20 09:12:51 +01:00