1
0
mirror of https://github.com/mgechev/revive.git synced 2024-12-12 10:44:59 +02:00
Commit Graph

1046 Commits

Author SHA1 Message Date
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
Denis Voytyuk
4c84a170af
Allow import-blacklist to run against go test files (#862) 2023-08-09 22:37:50 +02:00
renovate[bot]
df39256ea7
fix(deps): update module golang.org/x/tools to v0.11.1 (#855)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-04 11:26:37 +02:00
Fagim Sadykov
8941d19026
imporve var-naming - add upperCaseConst option to allow UPPER_CASED constants #851 (#852)
* imporve `var-naming`  - add upperCaseConst  option to allow UPPER_CASED constants #851

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2023-07-31 09:09:38 +02:00
Damián Ferencz
7bd666898c
feat: add rule for redundant import alias (#854) 2023-07-31 08:22:40 +02:00
renovate[bot]
26bc59f58c
fix(deps): update github.com/chavacava/garif digest to 4bd63c2 (#838)
* fix(deps): update github.com/chavacava/garif digest to 4bd63c2

* fix garif level compatibility

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2023-07-29 11:45:34 +02:00
Ricardo Martin Marcucci
a155d92342
fix: support method call from structures for string-format (#840)
* fix: support method call from structures for string-format

* fix: added test for MR
2023-07-29 11:27:07 +02:00
renovate[bot]
6a2c5b132e
fix(deps): update module golang.org/x/tools to v0.11.0 (#848)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 15:32:27 -07:00
kerneltravel
95fcfe36f6
doc: add milvus to README usage (#845) (#847) 2023-07-05 08:12:42 +02:00
renovate[bot]
9564ad9f07
fix(deps): update module golang.org/x/tools to v0.10.0 (#841)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 09:43:34 -07:00
Robert Liebowitz
2b4286ede2
Drop if-return from default ruleset (#843)
The `if-return` rule was originally a golint rule which was removed
from their ruleset for being out of scope. Similarly, it was dropped
from revive intentionally as a result of #537. More recently, it was
reintroduced into the default ruleset as a result of #799 due to a
discrepancy in documentation without a discussion of whether this rule
in particular belonged as a part of that default rule set.

While it is no longer a goal of this project to align 100% with the
golint defaults, I believe that this rule gives bad advice often enough
that it should not be enabled by default.

For example, consider the following code:

```go
if err := func1(); err != nil {
	return err
}

if err := func2(); err != nil {
	return err
}

if err := func3(); err != nil {
	return err
}

return nil
```

The `if-return` rule considers this a violation of style, and instead
suggests the following:

```go
if err := func1(); err != nil {
	return err
}

if err := func2(); err != nil {
	return err
}

return func3()
```

While this is more terse, it has a few shortcomings compared to the
original. In particular, it means extending the size of the diff if
changing the order of checks, adding logic after the call that currently
happens to be last, or choosing to wrap the error. And in that last
case, it can make it less obvious that there is an unwrapped error being
propagated up the call stack.

This in practice has a very similar effect to disabling trailing commas;
while it is not necessarily wrong as a style choice, I don't believe it
warrants a position as part of the default ruleset here.

See-also: https://github.com/golang/lint/issues/363
2023-06-26 09:43:19 -07:00