1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00
Commit Graph

1136 Commits

Author SHA1 Message Date
chavacava
02f0a40e4e feature: Improve error-strings rule to detect acronyms and proper nouns (#1287) 2025-04-08 07:17:58 +02:00
chavacava
343da9fbf2 Refactor/exported (#1299)
* simplify comment analysis by just checking the first comment line with documentation information

* nit refactorings: common func for adding failures, reduce the use of "stutter", and other nitties

* removes use of "stutter" in test code

* move string interpolation into addFailuref
2025-04-07 20:59:55 +02:00
chavacava
5f32e8bffa chore: add lint and all targets to Makefile (#1298) 2025-04-07 11:24:19 +02:00
Semih Buyukgungor
c882cb8f4f exported: correctly report deprecation-only comments (#1295) 2025-04-06 12:59:04 +02:00
renovate[bot]
2442da0712 chore(deps): update module golang.org/x/sys to v0.32.0 (#1293) 2025-04-06 09:56:31 +02:00
renovate[bot]
a9ee63c60e chore(deps): update module golang.org/x/text to v0.24.0 (#1296) 2025-04-06 09:22:58 +02:00
Oleksandr Redko
62f0b012e5 docs: sort rules in README table (#1291) 2025-04-05 13:23:06 +02:00
chavacava
7f7f31aaaf feature: add support for properties tag in struct-tag rule (#1289) 2025-04-05 08:38:59 +02:00
alingse
d6ad7ce2cd fix: call fmt.Errorf with wrong err (#1290)
Signed-off-by: alingse <alingse@foxmail.com>
2025-04-04 16:40:17 +02:00
Semih Buyukgungor
f4e39a7aa8 fix false positive in useless-break when a label follows a break (#1286)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2025-04-04 08:45:40 +02:00
Gareth Jones
a50141aadb docs: place redundant-build-tag before redundant-import-alias (#1288) 2025-04-04 08:38:58 +02:00
renovate[bot]
379856ae9c chore(deps): update dependency go to v1.24.2 (#1285) 2025-04-03 19:22:11 +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>
v1.8.0
2025-03-28 09:34:20 +01:00
Oleksandr Redko
43a44af30f refactor: apply suggestions from gopls modernize (#1282) 2025-03-28 09:32:30 +01:00
Oleksandr Redko
561c949334 change: replace log with log/slog for logging (#1280)
* change: replace log with log/slog for logging
* add TODO about slog.DiscardHandler
2025-03-25 09:47:59 -07:00
renovate[bot]
88e5689475 fix(deps): update module github.com/burntsushi/toml to v1.5.0 (#1276)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-18 14:14:03 +01:00
chavacava
9919e6bbe0 refactor: replace IsAtLeastGo1* functions by IsAtLeastGoVersion (#1274) 2025-03-16 18:18:05 +01:00
renovate[bot]
770af80ab2 fix(deps): update module github.com/spf13/afero to v1.14.0 (#1271) 2025-03-16 11:53:27 +01:00
renovate[bot]
8b973cb1c5 fix(deps): update module github.com/spf13/afero to v1.13.0 (#1270)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-15 10:04:51 +01:00
AxiomaticFixedChimpanzee
b77bb1a9db fix: cognitive complexity nesting with if-else chains (#1268)
* test: prove bug in cognitive complexity rule

* fix: cognitive complexity nesting with if-else chains

Currently, an if-else chain will increase the nesting level and add the
nesting increment for every addition `else if` statement in an if-else
chain. This is incorrect behaviour; an `else if` statement should
increment complexity by 1 (regardless of current nesting level) and
leave the nesting level as-is.

For example, the following should yield a total complexity of 5:
```
for { // +1
    if a { // +2 (nesting = 1)
        foo()
    } else if b { // +1
        bar()
    } else if c { // +1
        baz()
    }
}
```

but the current implementation incorrectly increments the nesting level
with each `else if` and adds the nesting increment where it shouldn't:
```
for { // +1
    if a { // +2 (nesting = 1)
        foo()
    } else if b { // +3 (nesting = 2)
        bar()
    } else if c { // +4 (nesting = 3)
        baz()
    }
}
```
2025-03-13 08:31:26 +01:00
Oleksandr Redko
6d0498cb97 refactor: simplify File.disabledIntervals, add tests (#1216) 2025-03-07 06:18:24 +01:00
renovate[bot]
dc3de104c4 chore(deps): update module golang.org/x/text to v0.23.0 (#1259) 2025-03-07 06:16:36 +01:00
renovate[bot]
39ae68321a fix(deps): update module golang.org/x/tools to v0.31.0 (#1261)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-06 13:47:09 -08:00
chavacava
54ea25b718 doc: update description of struct-tag rule (#1262) 2025-03-06 22:38:54 +01:00
renovate[bot]
c940fa671b fix(deps): update module golang.org/x/mod to v0.24.0 (#1258) 2025-03-06 08:32:34 +01:00
renovate[bot]
c9c079f295 chore(deps): update module golang.org/x/sys to v0.31.0 (#1257) 2025-03-06 08:32:04 +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
b04d5a71b6 refactor: return error instead of panic (#1252) 2025-02-26 22:27:31 +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
Oleksandr Redko
9177f5044a test: re-enable and fix test case for getVersion (#1246) 2025-02-21 17:33:13 +01:00
Oleksandr Redko
8cd85e4e6c docs: describe configuration for error-strings rule (#1245) 2025-02-21 17:29:40 +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) v1.7.0 2025-02-16 11:31:17 +01:00
renovate[bot]
a59a2288fd chore(deps): update golang docker tag to v1.24 (#1232)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-13 17:07:22 +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
Ludovic Fernandez
9a54195228 fix: panic with getFieldTypeName (#1229)
* fix: panic with interface type and array

* replaces panic with a return of a default string

* review

---------

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
v1.6.1
2025-02-12 14:10:48 +01:00
renovate[bot]
3e3e9825db fix(deps): update module golang.org/x/tools to v0.30.0 (#1227) 2025-02-11 17:10:03 +01:00
renovate[bot]
82dd1920b0 chore(deps): update module golang.org/x/sys to v0.30.0 (#1224)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 20:56:31 +01:00
renovate[bot]
f66fd1eb75 chore(deps): update module golang.org/x/text to v0.22.0 (#1225)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 20:52:16 +01:00
renovate[bot]
d04f429918 fix(deps): update module golang.org/x/sync to v0.11.0 (#1220)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:59:36 +01:00
renovate[bot]
ea0222b242 fix(deps): update module golang.org/x/mod to v0.23.0 (#1219)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:53:48 +01:00
renovate[bot]
3b54068168 chore(deps): update module github.com/stretchr/testify to v1.10.0 (#1223)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:49:47 +01:00
renovate[bot]
d02fd30f5c chore(deps): update module github.com/mattn/go-colorable to v0.1.14 (#1222)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-04 19:49:27 +01:00
Denis Voytyuk
c237f70575 Update renovate.json config (#1221) 2025-02-04 19:45:32 +01:00
Marcin Federowicz
e8b55f8917 prepareSkips: to resolve regexps in excludes (#1060)
* prepareSkips: to resolve regexps in excludes

* prepareSkips: to resolve regexps in excludes

* cleanup

* errorf: format

* doublestar/v4: latest version
2025-02-04 19:17:59 +01:00
chavacava
fd8d99d716 fix (1217): getting parameter type names panics in presence of generic types (#1218) 2025-02-04 12:26:17 +01:00