1
0
mirror of https://github.com/mgechev/revive.git synced 2025-06-04 23:07:22 +02:00

1161 Commits

Author SHA1 Message Date
Hazhir Derakhshi
f3f77bb387
refactor: remove tablewriter dependency (#1351)
* Rewrite Friendly.table method to replace tablewriter with fmt.Fprintf

* Refactor Stylish formatter to use custom table rendering instead of tablewriter

* Refactor Friendly and Stylish formatters to utilize a new custom table rendering function

* Remove unused dependencies from go.mod and go.sum

* Refactor table formatting by replacing formatTable with a new table function in friendly.go

* Utilize text/tabwriter in fromatting a table

* Refactor table function to use bytes.Buffer for improved performance
2025-05-17 19:33:14 +02:00
Oleksandr Redko
254bb41730
chore: remove unused deploy key (#1352) 2025-05-16 14:41:54 +02:00
Arjun Rajpal
26125211ba
Integrate golangci-lint into CI/CD pipeline (#1346)
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-05-16 05:12:23 -07:00
Oleksandr Redko
da3ba31922
docs: fix displaying rules table on revive.run (#1349) 2025-05-15 12:21:36 -07:00
Maria Ines Parnisari
f6cc22de4d
update garif (#1340) 2025-05-08 10:19:22 +02:00
renovate[bot]
5c4ed0917b
fix(deps): update module golang.org/x/tools to v0.33.0 (#1339)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 17:42:24 -07:00
renovate[bot]
9f0dedcc82
chore(deps): update module golang.org/x/text to v0.25.0 (#1338)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 17:38:40 -07:00
renovate[bot]
0fd7f16a68
chore(deps): update module golang.org/x/sys to v0.33.0 (#1336)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 12:01:51 -07:00
renovate[bot]
a94da3b667
fix(deps): update module golang.org/x/sync to v0.14.0 (#1337)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 12:01:33 -07:00
Oleksandr Redko
724a4ca419
chore: remove redundant //revive:disable-line (#1335) 2025-05-02 02:02:31 -07:00
Oleksandr Redko
48c047b4fb
chore: avoid third-party morphy2k/revive-action in CI (#1334) 2025-05-02 02:00:30 -07:00
Oleksandr Redko
906dcefddb
chore: remove redundant typeparams for Go 1.17 (#1331) 2025-05-01 02:44:38 -07:00
Oleksandr Redko
a5e5d78760
chore: enable a few revive rules (#1330) 2025-05-01 02:40:29 -07:00
chavacava
dbcfd66945
fix(1323): false positive in get-return rule for HTTP Get handlers (#1325) 2025-04-27 13:06:29 +02:00
Marcin Federowicz
7ba6ad4fcd
var-naming: remove regex from code (#1322)
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-04-25 01:32:03 -07:00
chavacava
d8a47ba18e
var-name checks each package name only once (#1319) 2025-04-24 14:29:39 +02:00
Oleksandr Redko
17527c928b
docs: adapt golangci-lint configuration to v2 (#1318) 2025-04-17 01:40:28 -07:00
Oleksandr Redko
558580268e
var-naming: detect meaningless package names (#1312) 2025-04-16 02:30:28 -07:00
Ludovic Fernandez
57ed899d0c
fix: add missing TypeCheck call (#1308) v1.9.0 2025-04-10 07:57:56 +02: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
Ludovic Fernandez
8221f8516d
chore: remove edited trigger (#1309) 2025-04-10 07:47:02 +02:00
Ludovic Fernandez
fbd90be544
fix: race condition of Package fields (#1307) 2025-04-10 07:44:38 +02:00
chavacava
f0eea95daf
struct-tag: change reported messages and refactor implementation (#1292) 2025-04-10 07:43:35 +02:00
renovate[bot]
535ec5a470
fix(deps): update module golang.org/x/tools to v0.32.0 (#1301)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-08 13:45:47 +02:00
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