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
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
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
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
Oleksandr Redko
ccae54e04e
refactor: remove unused parameter from pick function ( #932 )
2023-11-06 11:01:38 +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
Marcin Federowicz
fb5bbe72e7
fix: literal calls case ( #909 )
2023-09-30 10:18:17 +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
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
Denis Voytyuk
ca0678cd08
fix: dot-imports does not check test files ( #884 )
2023-08-30 08:06:58 +02: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