1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
Commit Graph

109 Commits

Author SHA1 Message Date
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
Denis Voytyuk
8d5724f746
feat: add support for enforce-repeated-arg-type-style rule (#953) 2023-12-27 10:30:09 +01:00
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
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
fd9a130d7a
Add denyRegex support for import-alias-naming rule (#927) 2023-10-29 13:19:53 +01: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
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
f900b6c2d4
feat: add support for import-alias-naming rule (#881) 2023-08-28 15:26:00 +02:00
Fagim Sadykov
310d1d76e4
per-rule file exclude filters (#850) (#857) 2023-08-12 08:21:11 +02:00
Fagim Sadykov
b31eb18b1f
adds [allowRegex] parameter for unused-parameter and unused-receiver rules (#858) 2023-08-11 07:35:08 +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
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
Miles Delahunty
ae07914dc4
ifelse: option to preserve variable scope (#832)
* ifelse: option to preserve variable scope
2023-05-23 10:10:09 +02:00
Minko Gechev
6d5bc51b50
Move away from deprecated ioutils (#825)
Fix #806
2023-05-16 08:06:52 +02:00
chavacava
6fd2c76c7d
fix issue #520 (#802) 2023-03-14 16:16:12 -07:00
Buyanov Vladimir
7b1458a9cb
fix #754 [rule.unhandled-error] change arguments to regexp (#757)
* fix #754 [rule.unhandled-error] change arguments to regexp

* Update unhandled-error-w-ignorelist.go

* Update unhandled-error_test.go

* Update unhandled-error-w-ignorelist.go

* adds config backward compatibility test

* fix #754 [rule.unhandled-error] change arguments to regexp

* fix #754 [rule.unhandled-error] change arguments to regexp

* fix #754 [rule.unhandled-error] change arguments to regexp

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-11-09 13:13:52 +01:00
Shubh Karman Singh
5f26378cc2
Comment spacing rule (#761)
* added comment-spacing rule for revive

* added test for comment-spacings rule

* adds comment-spacings rule to the configuration

* renames the source file to match rule name

* adds some tests

* refactor Comment-Spacings Rule to remove whiteList and avoid Panic at empty comment

* refactoring and adds rule configuration

* adds rule documentation

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-10-29 19:32:42 +02:00
chavacava
32a0cb8052
Allows inversing the semantics of string-format rule configurations (#765)
* allows negating the regexp

* updates rule documentation

* adds mgechev remarks
2022-10-24 20:48:41 +02:00
Buyanov Vladimir
1c3a15caaa
fix #759 [rule.add-constant] change 'ignoreFuncs' expressions in documentation and test (#760) 2022-10-15 11:24:32 +02:00
Buyanov Vladimir
3d83403fb8
fix #751 [rule.add-constant] add ignoreFuncs to exclude constants in … (#756)
* fix #751 [rule.add-constant] add ignoreFuncs to exclude constants in functions

* Update add-constant.go

* Update add-constant.go

* fix #751 [rule.add-constant] add ignoreFuncs to exclude constants in functions

* add details to regex-related errors

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-10-13 13:23:23 +02:00
hulk
ce7f0669d3
Allow to customize user functions in rule error-strings (#703)
* Allow to customize user functions in rule `error-strings`

* Rollback the Available Rules table format in README

* adds memoization of the rule's configuration

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-07-05 21:51:50 +02:00
Ivan Trubach
dc30eb1182
fix(receiver-naming): distinguish types with parameters (#692)
* fix(receiver-naming): distinguish types with parameters

* chore: run tests using supported Go versions matrix
2022-06-18 18:47:53 +02:00
Yudai Takada
e10678fea5
Fixes issue #619 imports-blacklist support regex (#684)
* Fixes issue #619 imports-blacklist support regex

* refactors method name and error message

* restores original test cases

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-04-21 16:04:00 +02:00
chavacava
a67ecdd7ba
add rule datarace (#683) 2022-04-18 09:45:42 -07:00
chavacava
04728cf0de
Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
chavacava
671c55d82e
adds rule use-any (#660) 2022-03-29 11:25:38 -07:00
chavacava
e0fa03a13a
Max open files (#628)
* adds max_open_files flag

* adds doc of max_open_files flag

* amends commmit
2022-02-07 17:36:03 -08:00
chavacava
b721f69625
fix #622 (Rule 'var-naming' should allow Fuzz_xxx) (#623) 2022-01-18 15:26:29 +01:00
Euan Kemp
af953e6189
Allow whitelist for the context parameter check (#616)
* Allow a whitelist for the context parameter check

This allows users to configure a set of types that may appear before
`context.Context`.

Notably, I think this rule is useful for allowing the `*testing.T` type
to come before `context.Context`, though there may be other uses (such
as putting a tracer before it, etc).

See #605 for a little more context on this.

Fixes #605

* Save a level of indentation in context-as-arg validation

We can unindent if we make the above check more specific

* refactoring taking into account chavacava's review

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2021-12-31 17:11:18 -08:00
SalvadorC
2c895fb33f
Code cleanup (#606) 2021-10-23 13:25:41 +02:00
doniacld
5d04216294
Add optimize-operands-order rule (#599) (#603)
Co-authored-by: SalvadorC <salvadorcavadini+github@gmail.com>
2021-10-23 09:29:14 +02:00
doniacld
be81121399
Add banned characters rule (#532) (#591) 2021-10-14 20:56:29 +02:00
sina safari
62db66915b
add new rule time equal (#584) 2021-10-01 13:55:53 +02:00
Oleg Butuzov
d7e3d5eac7
fix: time-naming issue #571 (#572)
resolves #571
2021-09-12 16:09:14 -07:00
SalvadorC
18cdb55850
Exported config (#565)
* working version

* adds flag for replacing "stutters"
2021-08-26 08:36:24 -07:00
SalvadorC
c939bb6af8
add new rule useless-break (#551) 2021-08-15 15:30:08 -07:00
SalvadorC
89f108c22a
fix issue #540 (#543) 2021-07-11 21:31:46 -07:00
SalvadorC
ea51f7aa3f
fix issue #537 (#538) 2021-06-29 13:04:51 -07:00
Robert Deusser
575ce5f61a
new rule: nested-structs (#530)
new rule: nested-structs
2021-06-15 11:36:41 +02:00
Keith Scroggs
2afe668e7b
Check string literals against regular expressions (#511)
Add string-format rule
2021-04-18 18:35:30 +02:00
SalvadorC
46f65914e3
new rule function-length (#504) 2021-03-20 15:45:30 -07:00
Minko Gechev
688024a5ca
Add revive linting action and fix linting errors (#455) 2020-08-15 00:50:13 +03:00
SalvadorC
1412d0c6ed
new rule: unexported-naming (#443)
* new rule: unexported-naming

* better failure message
2020-07-23 02:17:20 +03:00
chavacava
ad3100c9ec adds defer rule 2020-06-08 09:40:38 -07:00