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

9 Commits

Author SHA1 Message Date
Dian
44eed7edb7 fix error return rule to allow multiple error return values (#110)
* fix error return rule to allow multiple error return values

please check golint related updates here: golang/lint@8379672

When returning multiple values with an error,
lint checks if the error is the last return value.
But the implementation actually is checking for all return values
except for the last one, and throw the alert if it found an error.

There is a (edge) case where some function returning more than one error
is getting a false positive even when the last return value is an error.

This patch adds an early check, to see if the last return value is an error
and if so, it will pass silently.

* Fix return error

* add test changes
2019-03-20 11:54:27 -07:00
Minko Gechev
f966283f3e
Fix rule for documentation of exported types (#29)
* Fix rule for documentation of exported types

The rule was failing in the following case:

```go
// A is an awesome type
type A = int
```

Because revive was skipping the leading `A`, considering it as an article.

* Add "This" article and update Makefile
2018-07-08 08:14:15 +10:00
chavacava
4e19174270 Fix issue19 (#20)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* fix issue 19
2018-06-13 07:01:31 -07:00
Tamir Duberstein
1b2ffe282e Improve tests (#18)
* Use subtests

* Make unexported-return type check
2018-06-11 11:22:06 -07:00
mgechev
67d38b3b9f
Add test case for unexported-return 2018-06-02 09:45:19 -07:00
mgechev
55145d7427
Run var-naming on test files 2018-05-30 17:41:02 -07:00
mgechev
6c9ea8cf2d
Refactoring and renaming 2018-05-26 21:28:31 -07:00
mgechev
8c53dad5ec
Rename and docs 2018-05-26 16:14:36 -07:00
mgechev
8187cdf97d Refactoring of the tests 2018-02-04 15:02:45 -08:00