1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-10 03:17:11 +02:00
Commit Graph

208 Commits

Author SHA1 Message Date
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
chavacava
9b297848d9
adds comments-density rule (#979) 2024-04-20 10:20:56 +02: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
Denis Voytyuk
4b62e4b6e5
Update list of contributors (#960) 2024-01-08 10:00:05 +01:00
Denis Voytyuk
8d5724f746
feat: add support for enforce-repeated-arg-type-style rule (#953) 2023-12-27 10:30: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
bcae8c78ca
fix trailing whitespaces (#917) 2023-10-27 07:26:27 +02:00
y-yagi
d631844aeb
Fix link to the build (#911) 2023-10-03 11:27:00 +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
Damián Ferencz
7bd666898c
feat: add rule for redundant import alias (#854) 2023-07-31 08:22:40 +02:00
kerneltravel
95fcfe36f6
doc: add milvus to README usage (#845) (#847) 2023-07-05 08:12:42 +02: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
Onur Cinar
e5d5d09026
Adding Checker Go library to the list of Who Uses. (#842)
Proposing to add the Checker Go library to the list of Who Uses.
2023-06-22 08:56:53 +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
chavacava
2a1838f501
adds default config to enable all rules work out of the box (#830)
* adds default config to enable all rules out of the box
2023-05-20 14:44:34 +02:00
chavacava
6fd2c76c7d
fix issue #520 (#802) 2023-03-14 16:16:12 -07:00
Miles Delahunty
b87d391ee4
Fix early-return false positive and other tweaks (#776) 2022-11-27 13:23:51 +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
Tom
5cc9e27ddb
docs(README): add missing links and fix a broken one (#758) 2022-10-11 21:32:14 -07:00
Hsing-Yu (David) Chen
b4201ff650
Fix broken link of 'Comment Directives' in README (#753) 2022-10-06 11:05:23 +02:00
Rafael Madriz
a4add4a769
docs(README): Add neovim support in text editors section (#734)
* add instructions for using revive from neovim
2022-08-20 06:58:47 +02:00
ccoVeille
fa350e6eb8
fix some typos in repository (#728) 2022-08-08 13:48:59 +02:00
ccoVeille
160dfbd4ad
fix documentation (#730)
An entry was missing since banned-characters was added

Closes #729
2022-08-08 13:21:09 +02:00
likyh
23ed063531
doc: add devlake to README usage (#704)
Co-authored-by: linyh <yanghui@meri.co>
2022-07-12 10:15:02 +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
chavacava
a67ecdd7ba
add rule datarace (#683) 2022-04-18 09:45:42 -07:00
mgechev
639d12bb4f Merge branch 'master' of github.com:mgechev/revive
* 'master' of github.com:mgechev/revive:
  Fix README example's missing import (#661)
2022-03-29 13:34:57 -07:00
mgechev
8bbeab214b Update the contributors list 2022-03-29 13:34:37 -07:00
Bernardo Heynemann
5996bb0b66
Fix README example's missing import (#661)
* Fix example missing import

* Tab and spaces

Co-authored-by: Bernardo Heynemann <bernardo.heynemann@coinbase.com>
2022-03-29 13:30:36 -07:00
chavacava
671c55d82e
adds rule use-any (#660) 2022-03-29 11:25:38 -07:00
Bernardo Heynemann
318db94210
Separating lib from cli (#655)
* Separating lib from cli

* Renamed NewRevive to New

* Added GetLintFailures helper function

* Moved formatter to call to format since that's when it's needed

* makes fields of Revive struct non-public

* minor modifs in tests: remove unnamed constats

* Added lint package management to lint command

* README message for using revive as a library

* README formatting

* Removed unused method

* Slightly improved wording in README

* Handling format errors

* Renaming file to better reflect intent

* Refactoring pattern usage

* README heads

* renames excludePaths into excludePatterns

Co-authored-by: Bernardo Heynemann <bernardo.heynemann@coinbase.com>
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-03-29 17:31:52 +02:00
chavacava
5f6f0eb142
adds usage of revive as third party library (#653) 2022-03-20 12:53:57 +01: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
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
c0f2d40eaa
Add Docker image in release (#489) (#590) 2021-10-15 08:36:14 +02:00
doniacld
be81121399
Add banned characters rule (#532) (#591) 2021-10-14 20:56:29 +02:00
Jan Steinke
71b31e26ab
overwrite error status code from config with set_exit_status (#589)
add set_exit_status flag
2021-10-12 22:10:35 +02:00
Abel
935acca925
Fix typo for gorush description (#588) 2021-10-08 09:33:22 +02:00
sina safari
62db66915b
add new rule time equal (#584) 2021-10-01 13:55:53 +02:00
SalvadorC
18cdb55850
Exported config (#565)
* working version

* adds flag for replacing "stutters"
2021-08-26 08:36:24 -07:00
Bernhard Reisenberger
406b1ce110
range-val-address: fix false positive (#554)
range-val-address: fix false positive (closes #554)
2021-08-26 08:41:58 +02:00
mgechev
c383001338 Add Cadence by Uber 2021-08-18 11:03:47 -07:00
SalvadorC
351bb1277e
updates installation instructions (#562) 2021-08-17 18:02:22 +02:00
SalvadorC
c939bb6af8
add new rule useless-break (#551) 2021-08-15 15:30:08 -07:00
mgechev
a9ba67bacb Update the list of contributors 2021-07-11 21:35:26 -07:00