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

295 Commits

Author SHA1 Message Date
Oleksandr Redko
09fb350a27
unused-param,unused-receiver: refactor configure func (#1157) 2024-12-04 05:55:19 +01:00
Oleksandr Redko
7f7d024f11
unused-param,unused-receiver: fix panic message (#1156) 2024-12-03 17:08:21 +01:00
Oleksandr Redko
a48710b04b
deep-exit: ignore testable examples (#1155) 2024-12-03 15:39:07 +01:00
Denis Voytyuk
dde83449d7
chore: add missing tests for var-declarations, fix any/interface{} type issue (#1154)
* chore: add missing tests for var-declarations, fix any/interface{} type issue
2024-12-02 13:06:52 +01:00
Oleksandr Redko
d181862481
docs: fix rule descriptions (#1147) 2024-12-01 16:44:41 +01:00
Oleksandr Redko
bb9e681da6
cognitive-complexity: handle direct recursion (#1149) 2024-12-01 12:16:06 +01:00
Denis Voytyuk
3bc240434f
deep-exit: fix mixed receiver type (lintDeepExit) (#1150) 2024-11-30 10:06:59 +01:00
Miles Delahunty
7e1d35d8d2
feat: optional extension to early-return rule (#1133) (#1138) 2024-11-28 08:51:33 +01:00
Oleksandr Redko
777abc9c35
refactor: avoid duplicated exitFunctions map (#1145) 2024-11-28 08:47:10 +01:00
chavacava
d2778f36f1
adds rule use-errors-new (#1142)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-11-22 08:22:51 +01:00
chavacava
213d960d34
rename unused parameter (#1143) 2024-11-20 22:26:19 +01:00
chavacava
303ae4a4be
refactor: remove useless failure slice declaration (#1141)
Co-authored-by: chavacava <salvador.cavadini@gmail.com>
2024-11-20 20:41:07 +01:00
Oleksandr Redko
7f769f8c16
feat: add redundant-build-tag rule (#1135) 2024-11-20 20:26:28 +01:00
Oleksandr Redko
0e8acea6ce
refactor: move functions out from utils.go (#1139) 2024-11-19 13:58:14 -08:00
Oleksandr Redko
1425e2f44c
refactor: simplify with strings.Prefix, strings.CutPrefix (#1137) 2024-11-19 15:43:04 +01:00
Oleksandr Redko
d81fc8fab3
refactor: reduce control nesting in AddConstantRule.configure (#1128) 2024-11-18 14:38:56 +01:00
Oleksandr Redko
0afba4ff15
refactor: enforce map and slice style (#1131) 2024-11-16 18:05:30 +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
Oleksandr Redko
3378f7033b
refactor: replace mutex with sync.Once for rule configuration (#1118) 2024-11-15 12:03:59 +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
Oleksandr Redko
2ae682968f
refactor: remove unused parameter in unexported function (#1096) 2024-11-07 08:58:37 -03: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
Oleksandr Redko
9a8587cc49
revive: add revive.toml for linting revive itself (#1094) 2024-11-04 09:18:17 -03:00
chavacava
eb18252088
adds filename-format rule (#1092) 2024-11-02 14:23:46 -03:00
Oleksandr Redko
0ac1ef7298
refactor: fix revive.early-return issues (#1087) 2024-10-29 08:48:49 -03:00
Oleksandr Redko
3bead6f4a0
feat: add file-length-limit rule (#1072) 2024-10-26 07:40:24 -03:00
Oleksandr Redko
599874c773
chore: remove unnecessary empty lines (#1080) 2024-10-26 07:35:02 -03: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
ca2a32b087
code cleanup (#1054) 2024-10-01 12:14:02 +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
fa37c00bdf
removes redefinition of max built-in (#1052) 2024-09-29 10:08:15 +02:00
chavacava
4c3641ebc3
fix #1032 by comparing string representations of types (#1049) 2024-09-24 11:29:20 +02:00
Denis Voytyuk
3249a5ef06
fix: enforce-repeated-arg-type-style rule finds false positives in case of invalid types (#1046)
* fix: enforce-repeated-arg-type-style rule finds false positives in case of invalid types

* Fix oversight issue
2024-09-23 13:48:49 +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
yuta nishiyama
6b745b0075
fix lint issues (#1038) 2024-09-16 09:32:34 +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
Trifun
a638ed6e24
Add multiple scopes support to string-format rule (#1009)
* Add multiple scopes support to string-format rule

* Add new parsing rule

* Fix example
2024-08-09 21:01:17 +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
Arash Hatami
bf7adb69ad
Update README.md & Typo (#1010)
* docs: update README.md

- Fix the Docker image version
- Syntax and grammer

* fix: typo for minimum
2024-07-11 09:56:42 +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
dominiquelefevre
4242f24f4d
Add support for the new implementation of for loop variables in go 1.22. (#993)
* Add support for the new behaviour of for loops in go 1.22.

Go 1.22 has changed the behaviour of for loops. Every iteration
makes new loop variables. It is now safe to take their addresses
because they are guaranteed to be unique. Similarly, it is now
safe to capture loop variables in functions.

* adds documentation for public function

---------

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2024-06-02 11:55:26 +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