1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-30 08:57:07 +02:00
Commit Graph

906 Commits

Author SHA1 Message Date
Oleksandr Redko
2a1701aadb
fix: enable tests in the test/utils.go file (#930) 2023-12-02 12:42:41 +01:00
Georgy Buranov
782f0f118c
variable to skip package name checks (#941)
* variable to skip package name checks

* add tests for skipPackageNameChecks

* Add documentation
2023-11-30 14:19:31 +01:00
renovate[bot]
d3aa99cf8b
chore(deps): update module github.com/spf13/afero to v1.11.0 (#945)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-28 15:50:12 +01:00
Bryan Boreham
7da6a39044
modifies-value-receiver: warn on slice or map (#943)
* modifies-value-receiver: warn on slice or map

Assignments which index into the slice or map are already ignored on
line 72, and those where the whole receiver is slice or map on line 50.
We should not ignore assignments where the member variable is slice
or map.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Remove extra space

---------

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Co-authored-by: Denis Voytyuk <5462781+denisvmedia@users.noreply.github.com>
2023-11-28 15:45:52 +01:00
renovate[bot]
2862d06d26
fix(deps): update module golang.org/x/tools to v0.16.0 (#944)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-28 00:20:17 -08:00
Marcin Federowicz
9e80d93545
extend parsing instructions to use json object instead of plain txt (#929) 2023-11-26 10:18:36 +01:00
Nahshon Unna Tsameret
9a2eab34f1
[dot-imports] support allow list of packages (#939)
Add the ability to allow list of packages to be dot imported.

Add a new don-imports configuration:
* `allowedPackages`: (string) comma-separated list of allowed dot import packages

Example:

```toml
[rule.dot-imports]
  arguments = [{ allowedPackages = "github.com/onsi/ginkgo/v2,github.com/onsi/gomega" }]
```
2023-11-26 10:07:12 +01:00
renovate[bot]
12dd587d41
fix(deps): update module github.com/fatih/color to v1.16.0 (#933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-26 09:18:01 +01:00
Denis Voytyuk
07eb59669a
fix: ignore dot import aliases in import-alias-naming rule (#938) 2023-11-26 08:57:34 +01:00
renovate[bot]
cdc8caf36b
fix(deps): update module golang.org/x/tools to v0.15.0 (#935)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-16 16:37:14 -08:00
Oleksandr Redko
ccae54e04e
refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
Oleksandr Redko
29ba247979
cli: refactor tests: use TestMain, t.Setenv (#931) 2023-11-02 17:07:46 +01:00
Eng Zer Jun
573f7153c1
var-naming: avoid allocations with (*regexp.Regexp).MatchString (#928) 2023-11-02 09:40:09 +01:00
Denis Voytyuk
fd9a130d7a
Add denyRegex support for import-alias-naming rule (#927) 2023-10-29 13:19:53 +01:00
WillAbides
cb72bd880d
formatters return output (#921)
Some of the formatters were writing directly to stdout instead of returning the output. That made them more difficult to use them with revivelib. This PR updates those formatters to write to a buffer and return the resulting string.
2023-10-29 08:05:08 +01:00
Marcin Federowicz
25ae73a67a
fix:ignore color marks when compare stings in test (#926) 2023-10-29 07:43:52 +01:00
Marcin Federowicz
bcae8c78ca
fix trailing whitespaces (#917) 2023-10-27 07:26:27 +02:00
Gavin Inglis
1ef3c0f554
refactor: remove refs to io/ioutil (#918)
Signed-off-by: ginglis13 <ginglis05@gmail.com>
2023-10-14 19:25:25 +02:00
renovate[bot]
8dbd58748a
fix(deps): update module golang.org/x/tools to v0.14.0 (#915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-07 08:18:57 +02:00
Marcin Federowicz
cd2737acb4
Load config from different locations prefer XDG_CONFIG_HOME before HOME (#912) 2023-10-03 20:07:00 +02:00
y-yagi
d631844aeb
Fix link to the build (#911) 2023-10-03 11:27:00 +02:00
Marcin Federowicz
fb5bbe72e7
fix: literal calls case (#909) 2023-09-30 10:18:17 +02:00
Marcin Federowicz
cdb82683b1
cleanup rules descriptions (#908) 2023-09-25 06:51:12 +02:00
Marcin Federowicz
70ceb1cbfb
cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
Marcin Federowicz
36c2ee2718
code cleanup: replace interface{} with any (#906) 2023-09-24 08:44:02 +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
Denis Voytyuk
50091409c0
feat: add support for enforce-slice-style rule (#900) 2023-09-23 09:05:52 +02:00
Ludovic Fernandez
5c69df7eb3
doc: fix examples (#899) 2023-09-19 09:03:56 +02:00
chavacava
93219dac49
updates checksums (#897) 2023-09-17 11:35:06 +02:00
Denis Voytyuk
356e667369
feat: add support for enforce-map-style rule (#895)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2023-09-17 11:22:11 +02:00
chavacava
7dffe3ca48
quit config asap, remove unused pkg info (#896) 2023-09-17 11:10:49 +02:00
Dirk Faust
95acb880a1
Add unchecked-type-assertion (#889)
Co-authored-by: Dirk Faust <d.faust@mittwald.de>
2023-09-17 10:58:45 +02:00
renovate[bot]
3da2646e25
fix(deps): update module golang.org/x/tools to v0.13.0 (#887)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-15 15:11:34 +02:00
Denis Voytyuk
ca0678cd08
fix: dot-imports does not check test files (#884) 2023-08-30 08:06:58 +02:00
renovate[bot]
883c4cc199
fix(deps): update module github.com/chavacava/garif to v0.1.0 (#882)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-28 10:49:56 -07:00
Denis Voytyuk
f900b6c2d4
feat: add support for import-alias-naming rule (#881) 2023-08-28 15:26:00 +02:00
Oleksandr Redko
0357df7bc0
fix: add missing defer when unlocking mutex (#879) 2023-08-25 13:20:27 +02:00
mgechev
9a87e6fd82 Update goreleaser 2023-08-24 10:41:23 -07:00
Denis Voytyuk
a4ae369945
build: shift to the supported go versions (1.20 and 1.21) (#878) 2023-08-22 09:18:10 +02:00
Denis Voytyuk
4ee7542478
fix: false positive in import-shadowing for method names (#876) 2023-08-21 23:45:41 +02:00
chavacava
e758901c9a
Revert "fix: unnecesary alert for use-any when comments inside interface{} (#873)" (#874)
This reverts commit 519ffbdd7a.
2023-08-19 08:07:28 +02:00
chavacava
9acfcc8f86
fix #863:false positive on return statement in a func lit passed to the deferred function (#870) 2023-08-18 11:21:42 -07:00
Damián Ferencz
519ffbdd7a
fix: unnecesary alert for use-any when comments inside interface{} (#873)
* feat: add rule for unused import alias

* fix: rename rule

* fix: rename rule

* fix: use-any skip comments inside interface{}
2023-08-18 11:21:10 -07:00
Martins Irbe
19a95d9a7f
resolve #867: remove k[A-Z][A-Za-z\d]*$ sub-rule from var-naming (#871) 2023-08-16 13:23:29 +02:00
chavacava
16871ed55f
fix #864: confusing-naming FP on methods of generic types (#869) 2023-08-12 10:56:53 +02:00
chavacava
7cb4540a46
fix #846: time-equal garbled message when time returned from function (#868) 2023-08-12 09:05:46 +02:00
fregin
72f9108792
(var-naming) support private uppercase constants #865 (#866) 2023-08-12 08:45:42 +02:00
Fagim Sadykov
310d1d76e4
per-rule file exclude filters (#850) (#857) 2023-08-12 08:21:11 +02:00
renovate[bot]
b4fc3db692
fix(deps): update module golang.org/x/tools to v0.12.0 (#859) 2023-08-11 07:36:18 +02:00
Fagim Sadykov
b31eb18b1f
adds [allowRegex] parameter for unused-parameter and unused-receiver rules (#858) 2023-08-11 07:35:08 +02:00