1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-21 17:16:40 +02:00
Commit Graph

140 Commits

Author SHA1 Message Date
Oleksandr Redko
7f769f8c16
feat: add redundant-build-tag rule (#1135) 2024-11-20 20:26:28 +01:00
Oleksandr Redko
19834d40a4
test: add default case when no arguments provided to a rule (#1140) 2024-11-20 20:19:17 +01:00
Oleksandr Redko
d81fc8fab3
refactor: reduce control nesting in AddConstantRule.configure (#1128) 2024-11-18 14:38:56 +01:00
Väinö Leppänen
dff4dc9495
Filename-format rule: fix filename extension regex: ".go" to "\\.go". (#1132) 2024-11-16 16:12:26 +01:00
chavacava
7ee4500e12
fix: fixes #1103 by fixing the processing of max-public-structs arguments (#1114) 2024-11-15 09:43:53 +01:00
chavacava
cc3ad5f702
fix #1066 by ignoring what seems legit modification of value receivers 2024-11-15 09:41:29 +01:00
Oleksandr Redko
be95bfa705 refactor: rename files to follow Go convention 2024-11-11 19:31:18 +01:00
centralab
c0d4d07ab6 fix: nil panic on old go.mod (issue #1100) 2024-11-11 18:50:12 +01:00
chavacava
7c068a7dde
fix duplicated findings for string-format when there is more than one… (#1085) 2024-11-04 09:19:29 -03:00
Oleksandr Redko
fa9af82039
fix: change "GO" to "Go" in the use-any rule (#1077) 2024-11-04 09:18:50 -03:00
chavacava
eb18252088
adds filename-format rule (#1092) 2024-11-02 14:23:46 -03:00
Oleksandr Redko
3bead6f4a0
feat: add file-length-limit rule (#1072) 2024-10-26 07:40:24 -03:00
Marcin Federowicz
d76ffb98f6
update testdata: var case (#1055) 2024-10-02 12:20:39 +02:00
Marcin Federowicz
ff7b0adb4c
rule.exported: add feature to disable checking on const,method,function, variable (#1047)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2024-10-02 10:46:52 +02:00
chavacava
798ce21849
makes exported rule behave as golint (#1051)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-09-29 22:50:49 +02:00
chavacava
4c3641ebc3
fix #1032 by comparing string representations of types (#1049) 2024-09-24 11:29:20 +02:00
chavacava
53a111d36e
adds check for receiver names length (#1048)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
Co-authored-by: yuta nishiyama <57400690+ytnsym@users.noreply.github.com>
2024-09-23 12:38:39 +02:00
chavacava
a65fb8d1b5
adds tests for specific go versions (#1043)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-09-20 16:09:24 +02:00
Oleksandr Redko
8bea739f45
docs: fix typo in comments (#1037) 2024-09-14 21:38:06 +02:00
chavacava
6a139caf92
fix #1029 (#1030) 2024-08-21 10:38:34 +02:00
Shoichi Kaji
05c4801f9b
check param, result, type param of function in redefines-builtin-id rule (#1023)
* check param, result, type param of function in redefines-builtin-id rule

* combine the if statements

* tiny refactoring to make it more Go idiomatic

---------

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2024-08-15 13:29:11 +02:00
Shoichi Kaji
e54773e4b9
check clear/max/min in redefines-builtin-id rule on go1.21+ (#1024)
* check clear/max/min in redefines-builtin-id rule on go1.21+

* Update rule/redefines-builtin-id.go

Co-authored-by: Denis Voytyuk <5462781+denisvmedia@users.noreply.github.com>

---------

Co-authored-by: Denis Voytyuk <5462781+denisvmedia@users.noreply.github.com>
2024-08-15 13:14:16 +02:00
Fagim Sadykov
8f9edc9fe7
#1002 - add "checkPublicInterface" option to "exported" rule to allow check documentation on public methods on public interfaces (#1003)
* [var-naming] handle private uppercased const

* FEATURE #1002 - "checkPublicInterface" option for "exported" rule - to check public interface method comments

* fix exported #1002 for ast.Ident

* fix exported #1002 for ast.Ident 2

* go fmt applyed

* #1002 update documentation on `exported` rule

* refactor `exported` rule configuration logic

* test and review fixes

---------

Co-authored-by: fregin <freginpanklinshtern@gmail.com>
2024-07-30 10:36:03 +02:00
Songlin Yang
7ef710a0c2
fix(1007): return Sel.Name as FuncName when selector is an CallExpr (#1012)
Signed-off-by: lsytj0413 <511121939@qq.com>
2024-07-19 10:33:27 +02:00
Kostas Stamatakis
689291fbcb
rule optimize-operands-order: do not consider built-in len as a caller (#1005) 2024-07-02 08:22:13 +02:00
chavacava
5bf08fcd40
Fix 922 (#989)
* removes spurious warning on package comments starting with spaces

* skips directive comments when linting package comments

---------

Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-05-13 14:23:02 +02:00
Entuazism
993c9f68a9
fix #982 2024-05-11 19:50:30 +02:00
chavacava
2d3426f777
more precise regular expression for directive comments (#988)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-05-11 19:19:09 +02:00
chavacava
85333f8533
Fix #808 (#986)
fix #808 by using the official regexp for directives
---------

Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-05-10 12:11:05 +02:00
chavacava
9b297848d9
adds comments-density rule (#979) 2024-04-20 10:20:56 +02:00
Gustavo Alves
0a77458f89
remove colon suffix in comment-spacings rule (#981) 2024-04-19 16:39:59 +02:00
Jameel Al-Aziz
17a0393326
enforce-slice-style: Support nil declaration enforcement (#974)
* enforce-slice-style: Support nil declaration enforcement

Add support for enforcing nil slice declarations as recommended by both
the Go Code Review and Uber style guides.

This initial version is quite strict in that it also prevents using
empty literal and make-style slices in struct assignments and as
function arguments.

* Add more tests

* docs
2024-02-26 11:58:31 +01:00
chavacava
ef34f92cef
fix 968 by removing references to black and white lists (#969) 2024-02-03 18:36:44 +01:00
chavacava
3a62091839
Adds rule max-control-nesting (#967) 2024-01-28 12:22:41 +01:00
Stephen Buttolph
f547cb594e
Check function literals in unused-param (#966) 2024-01-27 13:39:55 +01:00
Vincent Baron
64dda06595
feat: capitalise var naming to IDs (#964)
* feat: capitalise var naming to IDs

* feat: added test case for IDs case
2024-01-17 14:01:40 +01:00
Marcin Federowicz
9abe06adfa
refactor: rename blacklist to blocklist and whitelist to allowlist (#946)
* refactor: rename blacklist to blocklist and whitelist to allowlist
2024-01-15 12:16:00 +01:00
Michael McLoughlin
be35a880ab
unhandled-error: use full function name in error message (#962)
* update tests

* Update testdata/unhandled-error-w-ignorelist.go

* Update testdata/unhandled-error-w-ignorelist.go

---------

Co-authored-by: Denis Voytyuk <5462781+denisvmedia@users.noreply.github.com>
2024-01-08 09:36:30 -08:00
Denis Voytyuk
f8e122f43d
fix: add-constant struct tags in anonymous struct literals false positive (#954)
* fix: add-constant struct tags in anonymous struct literals false positive
2023-12-28 23:59:58 +01:00
Denis Voytyuk
8d5724f746
feat: add support for enforce-repeated-arg-type-style rule (#953) 2023-12-27 10:30:09 +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
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
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
Denis Voytyuk
07eb59669a
fix: ignore dot import aliases in import-alias-naming rule (#938) 2023-11-26 08:57:34 +01:00
Denis Voytyuk
fd9a130d7a
Add denyRegex support for import-alias-naming rule (#927) 2023-10-29 13:19:53 +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
Marcin Federowicz
fb5bbe72e7
fix: literal calls case (#909) 2023-09-30 10:18:17 +02:00
Denis Voytyuk
50091409c0
feat: add support for enforce-slice-style rule (#900) 2023-09-23 09:05:52 +02:00