Skip to content

Releases: mgechev/revive

v1.13.0

14 Nov 11:06
ac5f398

Choose a tag to compare

What's Changed

Features

Bug fixes

  • fix: rule struct-tag false positive on validate:omitempty by @chavacava in #1525
  • import-shadowing: handle versioned packages correctly by @vbvictor in #1445
  • package-directory-mismatch: ignore main_test package name by @uloamaka in #1545
  • fix: false positive for return in a defer function has no effect by @chavacava in #1531
  • fix: rule struct-tag add all missing go-validator tags (#1526) by @focusaurus in #1533
  • fix: rule confusing-naming false positive on multiple blank identifiers by @emmanuel-ferdman in #1536
  • useless-fallthrough: do not report fallthrough before default by @anupriyakkumari in #1549
  • package-directory-mismatch: allow test package names in version paths by @thespags in #1547
  • package-directory-mismatch: ignore mismatch in root directory by @uloamaka in #1548

Updates

  • fix(deps): update module github.com/spf13/afero to v1.15.0 by @renovate[bot] in #1521
  • chore(deps): update golang docker tag to v1.25 by @renovate[bot] in #1474
  • docs: fix typos by @alexandear in #1553
  • feature: add enableDefaultRules config option by @cce in #1551
  • chore(deps): bump Go 1.24 by @alexandear in #1555
  • chore(deps): update github.com/golangci/golines digest to 8fd09d3 by @renovate[bot] in #1558
  • chore(deps): update golang.org/x/telemetry digest to 5cc343d by @renovate[bot] in #1559
  • chore(deps): update module github.com/catenacyber/perfsprint to v0.10.1 - autoclosed by @renovate[bot] in #1560
  • chore(deps): update github.com/golangci/gofmt digest to 3e58ba0 by @renovate[bot] in #1557
  • chore: update schedule in renovate config by @alexandear in #1571
  • chore(deps): update module dev.gaijin.team/go/golib to v0.7.0 - autoclosed by @renovate[bot] in #1570
  • chore(deps): update module google.golang.org/protobuf to v1.36.10 - autoclosed by @renovate[bot] in #1569
  • fix(deps): update module golang.org/x/sync to v0.18.0 by @renovate[bot] in #1572
  • change: merge code-style with style categories by @alexandear in #1573
  • chore(deps): update module golang.org/x/sys to v0.38.0 by @renovate[bot] in #1574
  • fix(deps): update module golang.org/x/tools to v0.39.0 by @renovate[bot] in #1577

Docs

New Contributors

Full Changelog: v1.12.0...v1.13.0

v1.12.0

28 Aug 11:12
e1d05f7

Choose a tag to compare

What's Changed

Features

Bug fixes

  • fix(1438): enforce-switch-style - false positive with pure return switch by @chavacava in #1446
  • fix: default formatter generates an extra new line by @chavacava in #1485

Updates

  • chore(deps): update module golang.org/x/text to v0.28.0 by @renovate[bot] in #1467
  • chore(deps): update module golang.org/x/sys to v0.35.0 by @renovate[bot] in #1466
  • fix(deps): update module golang.org/x/mod to v0.27.0 by @renovate[bot] in #1468
  • fix(deps): update module golang.org/x/tools to v0.36.0 by @renovate[bot] in #1469

Docs

New Contributors

Full Changelog: v1.11.0...v1.12.0

v1.11.0

12 Jul 07:54
9224327

Choose a tag to compare

What's Changed

Features

Bug fixes

  • fix: var-naming rule extraBadPackageNames type by @ldez in #1404
  • unexported-return: exclude main package and test files by @ccoVeille in #1399
  • unexported-return: fix type aliases support by @ldez in #1408
  • var-naming: option to skip initialism name checks by @krenzler in #1415
  • var-naming: handle possible panic by @alexandear in #1405

Updates

  • chore(deps): update module golang.org/x/text to v0.26.0 by @renovate[bot] in #1400
  • fix(deps): update module golang.org/x/tools to v0.34.0 by @renovate[bot] in #1402
  • chore(deps): update module golang.org/x/sys to v0.34.0 by @renovate[bot] in #1416
  • fix(deps): update module golang.org/x/sync to v0.16.0 by @renovate[bot] in #1417
  • chore(deps): update module golang.org/x/text to v0.27.0 by @renovate[bot] in #1418
  • fix(deps): update module golang.org/x/mod to v0.26.0 by @renovate[bot] in #1419
  • fix(deps): update module golang.org/x/tools to v0.35.0 by @renovate[bot] in #1423

Docs

  • docs: improve Installation section by @alexandear in #1409
  • docs: improve unhandled-error ignore argument examples by @scop in #1412

New Contributors

Full Changelog: v1.10.0...v1.11.0

v1.10.0

28 May 11:28
6becd54

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.9.0...v1.10.0

v1.9.0

11 Apr 16:13
57ed899

Choose a tag to compare

Changelog

  • 343da9f Refactor/exported (#1299)
  • 379856a chore(deps): update dependency go to v1.24.2 (#1285)
  • 2442da0 chore(deps): update module golang.org/x/sys to v0.32.0 (#1293)
  • a9ee63c chore(deps): update module golang.org/x/text to v0.24.0 (#1296)
  • 5f32e8b chore: add lint and all targets to Makefile (#1298)
  • 8221f85 chore: remove edited trigger (#1309)
  • c882cb8 exported: correctly report deprecation-only comments (#1295)
  • 02f0a40 feature: Improve error-strings rule to detect acronyms and proper nouns (#1287)
  • 7f7f31a feature: add support for properties tag in struct-tag rule (#1289)
  • f4e39a7 fix false positive in useless-break when a label follows a break (#1286)
  • 535ec5a fix(deps): update module golang.org/x/tools to v0.32.0 (#1301)
  • 57ed899 fix: add missing TypeCheck call (#1308)
  • d6ad7ce fix: call fmt.Errorf with wrong err (#1290)
  • fbd90be fix: race condition of Package fields (#1307)
  • 1cb97fd refactor: fix typos in comments and struct names (#1304)
  • f0eea95 struct-tag: change reported messages and refactor implementation (#1292)

v1.8.0

30 Mar 11:12
9f5f957

Choose a tag to compare

Changelog

  • 561c949 change: replace log with log/slog for logging (#1280)
  • c9c079f chore(deps): update module golang.org/x/sys to v0.31.0 (#1257)
  • dc3de10 chore(deps): update module golang.org/x/text to v0.23.0 (#1259)
  • 54ea25b doc: update description of struct-tag rule (#1262)
  • 4f34235 feature: add suport of mapstructure struct tags in struct-tag rule (#1241)
  • 3bbfedb feature: add suport of validate struct tags in struct-tag rule (#1244)
  • 88d5434 feature: add support for TOML struct tags in struct-tag rule (#1255)
  • 3cf67c5 feature: add support of URL struct tags in struct-tag rule (#1239)
  • a4ee892 feature: add support of datastore struct tags in struct-tag rume (#1240)
  • 88e5689 fix(deps): update module github.com/burntsushi/toml to v1.5.0 (#1276)
  • 8b973cb fix(deps): update module github.com/spf13/afero to v1.13.0 (#1270)
  • 770af80 fix(deps): update module github.com/spf13/afero to v1.14.0 (#1271)
  • c940fa6 fix(deps): update module golang.org/x/mod to v0.24.0 (#1258)
  • 39ae683 fix(deps): update module golang.org/x/tools to v0.31.0 (#1261)
  • b77bb1a fix: cognitive complexity nesting with if-else chains (#1268)
  • 67d0a61 fix: error-strings custom funcs overwrites defaults (#1249)
  • 77f4474 refactor: string-format implements ConfigurableRule (#1251)
  • 43a44af refactor: apply suggestions from gopls modernize (#1282)
  • 9919e6b refactor: replace IsAtLeastGo1* functions by IsAtLeastGoVersion (#1274)
  • b04d5a7 refactor: return error instead of panic (#1252)
  • 6d0498c refactor: simplify File.disabledIntervals, add tests (#1216)
  • 9f5f957 rule: allow lowercased and kebab-cased options (#1272)

v1.7.0

16 Feb 10:33
8ece20b

Choose a tag to compare

Changelog

  • a59a228 chore(deps): update golang docker tag to v1.24 (#1232)
  • 8ece20b feature: add support for omitzero in rule struct-tag (#1238)
  • 4020f43 fix: exclusions are no longer working as before (#1237)

v1.6.1

12 Feb 13:34
9a54195

Choose a tag to compare

Changelog

  • c237f70 Update renovate.json config (#1221)
  • d02fd30 chore(deps): update module github.com/mattn/go-colorable to v0.1.14 (#1222)
  • 3b54068 chore(deps): update module github.com/stretchr/testify to v1.10.0 (#1223)
  • 82dd192 chore(deps): update module golang.org/x/sys to v0.30.0 (#1224)
  • f66fd1e chore(deps): update module golang.org/x/text to v0.22.0 (#1225)
  • a34327e chore: check go.mod and run gofmt in CI (#1215)
  • 5f01efa feature: add redundant-test-main-exit rule (#1208)
  • fd8d99d fix (1217): getting parameter type names panics in presence of generic types (#1218)
  • ea0222b fix(deps): update module golang.org/x/mod to v0.23.0 (#1219)
  • d04f429 fix(deps): update module golang.org/x/sync to v0.11.0 (#1220)
  • 3e3e982 fix(deps): update module golang.org/x/tools to v0.30.0 (#1227)
  • 8c5d8fc fix: flag-parameter rule wrongly detects var definition and points to the function signature (#1213)
  • 8cb2599 fix: invalid message reported for directive comment (#1209)
  • 9a54195 fix: panic with getFieldTypeName (#1229)
  • 4bd6fba fix: unconditional-recursion false positive when the function is called right after its declaration (#1212) (#1214)
  • e8b55f8 prepareSkips: to resolve regexps in excludes (#1060)

v1.6.0

23 Jan 21:27
d9c61c1

Choose a tag to compare

Changelog

  • 275b018 refactor (rule/error-return): replace AST walker by iteration over declarations (#1163)
  • fcfd6ad refactor (rule/flag-param): replace AST walker by iteration over declarations (#1164)
  • a31d5af refactor (rule/modifies-value-receiver): replace AST walker by iteration over declarations (#1165)
  • dff4dc9 Filename-format rule: fix filename extension regex: ".go" to "\.go". (#1132)
  • 655e606 Update RULES_DESCRIPTIONS.md (#1134)
  • 7d97f54 [chore] clean up go.sum (#1201)
  • d2778f3 adds rule use-errors-new (#1142)
  • cb74ccb chore: Improve sortables detection (#1151)
  • 72b91f0 chore: Update go.sum (#1153)
  • dde8344 chore: add missing tests for var-declarations, fix any/interface{} type issue (#1154)
  • 4b2c76e chore: cleanup code in rules (#1197)
  • 4dd63ef chore: fix typo (#1187)
  • 45731a3 chore: migrate goreleaser config to v2 (#1105)
  • 10d9697 chore: remove unused #region comments (#1181)
  • d64bddc chore: use US English instead of UK English (#1186)
  • bb9e681 cognitive-complexity: handle direct recursion (#1149)
  • 3bc2404 deep-exit: fix mixed receiver type (lintDeepExit) (#1150)
  • a48710b deep-exit: ignore testable examples (#1155)
  • 7f769f8 feat: add redundant-build-tag rule (#1135)
  • 7e1d35d feat: optional extension to early-return rule (#1133) (#1138)
  • 57fe5b6 fix(deps): update module github.com/spf13/afero to v1.12.0 (#1200)
  • 47dc923 fix(deps): update module golang.org/x/tools to v0.28.0 (#1172)
  • 4ba2c56 fix(deps): update module golang.org/x/tools to v0.29.0 (#1198)
  • a106e63 fix(rule/modifies-value-receiver): miss modification by ++/-- (#1175)
  • 24a9325 fix: ast_utils.FuncSignatureIs panics with types names other than ast.Ident (#1174)
  • 772285d fix: change URL to the page with rules descriptions (#1129)
  • 98a6c97 fix: confusing-results doesn't work with pointer types (#1158)
  • 7998011 fix: return configure rule error (#1193)
  • d9c61c1 fix: running revive in CI (#1205)
  • c3b541f refactor (rule/arguments-limits): replace AST walker by iteration over declarations (#1159)
  • 4b13782 refactor (rule/cyclomatic): replace AST walker by iteration over declarations (#1161)
  • cb89a4c refactor (rule/datarace): replace AST walker by iteration over declarations (#1162)
  • 361c744 refactor (rule/function-length): replace AST walker by iteration over declarations (#1166)
  • a31d590 refactor (rule/function-result-limit): replace AST walker by iteration over declarations (#1167)
  • 3e1dbc0 refactor (rule/get-return): replace AST walker by iteration over declarations (#1168)
  • 5c2aadf refactor (rule/receiver-naming): replace AST walker by iteration over declarations (#1169)
  • 278246d refactor (rule/unexported-return): replace AST walker by iteration over declarations (#1170)
  • 8f54012 refactor (rule/unused-receiver): replace AST walker by iteration over declarations (#1171)
  • 9a5c95f refactor(rule/context-as-argument): replace AST walker by iteration over declarations (#1160)
  • f94c9d7 refactor: add all wait group delta at once when possible (#1179)
  • 777abc9 refactor: avoid duplicated exitFunctions map (#1145)
  • f6a3820 refactor: code cleanup (#1177)
  • 0afba4f refactor: enforce map and slice style (#1131)
  • 93c6bc8 refactor: extract getVersion function (#1127)
  • 77616f0 refactor: fix 'use-any' revive issues (#1204)
  • 3421eae refactor: fix linting issues (#1188)
  • 4ca2c11 refactor: get rid of mitchellh/go-homedir package (#1195)
  • e23fcdb refactor: modifies linting machinery to use Failure as a mean to signal erros in rules application (#1178)
  • 0e8acea refactor: move functions out from utils.go (#1139)
  • d81fc8f refactor: reduce control nesting in AddConstantRule.configure (#1128)
  • 06192a5 refactor: remove lint issues (#1176)
  • 660968f refactor: remove redundant fmt.Fprintln calls (#1130)
  • 303ae4a refactor: remove useless failure slice declaration (#1141)
  • 395f790 refactor: replace failure Category raw string with constant (#1196)
  • 9b15f3f refactor: replace panic with error in rules (#1126)
  • 3d1115d refactor: rule configuration and error management (#1185)
  • 78e927d refactor: simplify by using switch instead of if (#1190)
  • cadb2dd refactor: simplify config.GetFormatter; add tests (#1184)
  • 1425e2f refactor: simplify with strings.Prefix, strings.CutPrefix (#1137)
  • 7cbd3d1 refactor: use slices.SortFunc instead of sort.Slice (#1191)
  • 1b4440c refactor: use toml.Unmarshal instead of toml.Decode (#1122)
  • 213d960 rename unused parameter (#1143)
  • 7f7d024 unused-param,unused-receiver: fix panic message (#1156)
  • 09fb350 unused-param,unused-receiver: refactor configure func (#1157)
  • 1117372 update doc (#1203)

v1.5.1

16 Nov 10:45
3378f70

Choose a tag to compare

Changelog

  • cc3ad5f fix #1066 by ignoring what seems legit modification of value receivers
  • 1070fcd fix(deps): update module golang.org/x/mod to v0.22.0 (#1099)
  • a4d0c43 fix(deps): update module golang.org/x/tools to v0.27.0 (#1102)
  • ce69652 fix: cli tests on Windows; add tests-on-windows workflow
  • 7ee4500 fix: fixes #1103 by fixing the processing of max-public-structs arguments (#1114)
  • c0d4d07 fix: nil panic on old go.mod (issue #1100)
  • 74e2417 fix: revive hangs on Windows if go.mod is not found
  • 4c958ef refactor: remove redundant defer
  • be95bfa refactor: rename files to follow Go convention
  • 3378f70 refactor: replace mutex with sync.Once for rule configuration (#1118)