Releases: mgechev/revive
Releases · mgechev/revive
v1.13.0
What's Changed
Features
- feature: new rule inefficient-map-lookup by @chavacava in #1491
- feature: new rule
forbidden-call-in-wg-goby @chavacava in #1514 - struct-tag: support codec struct tag by @pashkov256 in #1507
- feature: support
cborstruct tag instruct-tagrule by @chavacava in #1527 - feature: add configuration option in
struct-tagrule to omit checking a tag by @chavacava in #1515 - feature: new rule
unnecessary-ifby @chavacava in #1520 - var-naming: add more bad package names by @Acollie in #1540
- deep-exit: detect exit-triggering flag usage by @uloamaka in #1544
Bug fixes
- fix: rule
struct-tagfalse positive onvalidate:omitemptyby @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 effectby @chavacava in #1531 - fix: rule
struct-tagadd all missing go-validator tags (#1526) by @focusaurus in #1533 - fix: rule
confusing-namingfalse 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
- docs: update TOC; check for TOC consistency in GHA by @alexandear in #1493
- doc: clearly identify configuration examples by @chavacava in #1504
- doc: add before/after examples to
confusing-resultsdescription by @chavacava in #1503 - doc: add before/after examples to
bool-literal-in-exprdescription by @chavacava in #1500 - docs: fix MD024/no-duplicate-heading lint issue by @alexandear in #1513
- docs: enhance struct-tag rule description by @alexandear in #1512
New Contributors
- @pashkov256 made their first contribution in #1507
- @focusaurus made their first contribution in #1533
- @Acollie made their first contribution in #1540
- @uloamaka made their first contribution in #1545
- @thespags made their first contribution in #1547
- @anupriyakkumari made their first contribution in #1549
Full Changelog: v1.12.0...v1.13.0
v1.12.0
What's Changed
Features
- exported: improve error message by @ccoVeille in #1403
- modifies-parameter: handle slices.Delete and slices.DeleteFunc by @vbvictor in #1427
- identical-branches: check branches of "if ... else if" chains by @chavacava in #1440
- feature: detect identical-branches in switch statements by @chavacava in #1448
- feature: new rule identical-switch-conditions by @chavacava in #1451
- feature: new rule identical-ifelseif-conditions by @chavacava in #1454
- Split
identical-branchesinto 3 rules by @chavacava in #1453 - feature: new rule useless-fallthrough by @chavacava in #1462
- struct-tag: support spanner struct tag by @sarthakw7 in #1479
- feature: new rule package-directory-mismatch by @vbvictor in #1429
- feature: detect useless options in spanner struct tag by @chavacava in #1483
- feature: struct-tag warns on (useless) options on ignored fields by @chavacava in #1487
- feature: new rule
use-waitgroup-goby @chavacava in #1484 - feature: new rule unsecure-url-scheme by @chavacava in #1478
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
- docs: add DeepWiki link to README by @alexandear in #1432
- docs: add missing use-waitgroup-go TOC entry by @alexandear in #1492
- docs: add info about
golangcode snippets by @alexandear in #1494
New Contributors
- @sarthakw7 made their first contribution in #1479
Full Changelog: v1.11.0...v1.12.0
v1.11.0
What's Changed
Features
- feature: new rule enforce-switch-default by @chavacava in #1390
- early-return: detect short deviated statements by @alexandear in #1396
- exported: ignore exported symbols from the main package by @alexandear in #1398
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
What's Changed
- var-naming: detect meaningless package names by @alexandear in #1312
- docs: update golangci-lint configuration to v2 by @alexandear in #1318
- var-name checks each package name only once by @chavacava in #1319
- var-naming: remove regex from code by @mfederowicz in #1322
- fix(1323): false positive in get-return rule for HTTP Get handlers by @chavacava in #1325
- chore: enable a few revive rules by @alexandear in #1330
- chore: remove redundant typeparams for Go 1.17 by @alexandear in #1331
- chore: avoid third-party morphy2k/revive-action in CI by @alexandear in #1334
- chore: remove redundant //revive:disable-line by @alexandear in #1335
- fix(deps): update module golang.org/x/sync to v0.14.0 by @renovate in #1337
- chore(deps): update module golang.org/x/sys to v0.33.0 by @renovate in #1336
- chore(deps): update module golang.org/x/text to v0.25.0 by @renovate in #1338
- fix(deps): update module golang.org/x/tools to v0.33.0 by @renovate in #1339
- chore(deps): update codeberg.org/chavacava/garif to v0.2.0 by @miparnisari in #1340
- docs: fix displaying rules table on revive.run by @alexandear in #1349
- Integrate golangci-lint into CI/CD pipeline by @ArjunRajpal123 in #1346
- chore: remove unused deploy key by @alexandear in #1352
- Remove tablewriter dependency by @volfgox in #1351
- tiny refactoring on friendly, sarif and stylish formatters by @chavacava in #1355
- fix(deps): update module github.com/mgechev/dots to v1.0.0 by @renovate in #1358
- Update rule description URLs to point to revive.run by @volfgox in #1360
- chore: add linter for Markdown files by @alexandear in #1361
- fix(#1367): struct-tag with validate is missing built-in rules by @chavacava in #1368
- time-date: add rule to check for time.Date usage by @ccoVeille in #1327
- fix(#1363): package-comments ignores //nolint directives by @chavacava in #1366
- refactor: removes
getfrom getters names by @chavacava in #1373 - refactor: test utils functions by removing redundant test instructions parsing and simplifying asserting functions by @chavacava in #1374
- docs: format code snippets in markdown files by @alexandear in #1324
- fix: avoid false positive for blank identifier by @ccoVeille in #1376
- chore: improve time-date decimal tests by @ccoVeille in #1378
- new rule to spot unnecessary use of formatting functions by @chavacava in #1372
- refactor: enable gocritic linter; fix lint issues by @alexandear in #1375
- refactor: gofmt testdata by @alexandear in #1379
- refactor: moves code related to AST from rule.utils into astutils package by @chavacava in #1380
- feature: Add nil timezone handling detection to time-date rule by @ccoVeille in #1377
- chore: enable thelper linter in golangci-lint by @ccoVeille in #1386
- chore: enable dupword linter in golangci-lint by @ccoVeille in #1385
- chore: enforce American English spelling in golangci-lint by @ccoVeille in #1384
- docs: improve comments for functions; enable godot by @alexandear in #1382
- docs: use contrib.rocks to make contributors section shorter by @alexandear in #1381
- feature: detect time/date out of bounds in time-date rule by @ccoVeille in #1370
- refactor: simplifies the implementation of rule call-to-gc by @chavacava in #1388
- feature: rule use-fmt-print by @chavacava in #1389
New Contributors
- @miparnisari made their first contribution in #1340
- @ArjunRajpal123 made their first contribution in #1346
- @volfgox made their first contribution in #1351
Full Changelog: v1.9.0...v1.10.0
v1.9.0
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
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-formatimplements 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
v1.6.1
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
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-tagrule (#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
switchinstead ofif(#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
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)