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

187 Commits

Author SHA1 Message Date
SalvadorC
771aa23069 bool-literal-in-expr (new rule) (#54)
* bool-literal-in-expr (new rule)

* bool-literal-in-expr: add test case and fix typo
2018-08-23 11:10:17 -07:00
SalvadorC
936bc94793 Adds details on disabling the linter on a specific line (#52) 2018-08-14 13:22:52 -07:00
SalvadorC
a2a52e398b Refactoring: removes unused function from modifies-param rule code (#50) 2018-08-13 15:19:00 -07:00
SalvadorC
613fd24a3b modifies-value-receiver (new rule) (#51) 2018-08-13 15:18:28 -07:00
SalvadorC
8ea88db68f struct-tag: add support for asn1 and bson (#49) 2018-08-07 11:28:45 -07:00
mgechev
6b0ad59b9d docs: reorder plugins 2018-07-31 12:20:58 -07:00
SalvadorC
6fa95fb6ba struct-tag (new rule) (#47) 2018-07-28 09:07:31 -07:00
SalvadorC
0404d66548 unnecessary-stmt (new rule) (#45)
* simpler (new rule)

* simpler: checks unitary switches

* unnecessary-stmt (new rule)
2018-07-27 22:38:39 -07:00
mgechev
7773f47324
Merge master 2018-07-23 16:45:40 -07:00
mgechev
3cbd027513
docs: add recommended config 2018-07-23 16:44:51 -07:00
SalvadorC
3d8d46af0b flag-parameter (new rule) (#44)
* flag-parameter (new rule)

* fix failure confidence
2018-07-21 22:58:48 -07:00
mgechev
f555377e10
Merge branch 'master' of github.com:mgechev/revive
* 'master' of github.com:mgechev/revive:
  add-constant (new rule) (#39)
  New rule: unreachable-code (#38)
  New formatter: checkstyle (#37)
  fix modifies-parameter name in README (#36)
2018-07-20 16:56:46 -07:00
mgechev
686fda4c1c
Update the list of contributors 2018-07-20 16:56:37 -07:00
chavacava
5248ad8ed9 add-constant (new rule) (#39) 2018-07-17 12:21:27 -07:00
chavacava
db6c522a37 New rule: unreachable-code (#38)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* [WIP] fix multiple file test

* draft solution for detecting confusing-names through multiple files

* [WIP] confusing-name multiple files

* clean-up

* draft working version

* cleaner version + more informative messages

* adds check on struct field names

* fix config.go

* clean master

* new ADS rule: newerr

* ADS-print working version

* ads-print final version

* ads-lost-err working version

* confusing-namming: fix tests

* removes ads-* rules

* rule unreachable-code

* unreachable-code refactored version

* skip corner case of mandatory return
2018-07-16 14:23:47 -07:00
chavacava
439cef2893 New formatter: checkstyle (#37)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* [WIP] fix multiple file test

* draft solution for detecting confusing-names through multiple files

* [WIP] confusing-name multiple files

* clean-up

* draft working version

* cleaner version + more informative messages

* adds check on struct field names

* fix config.go

* clean master

* new ADS rule: newerr

* ADS-print working version

* ads-print final version

* ads-lost-err working version

* confusing-namming: fix tests

* removes ads-* rules

* Adds checkstyle formatter

* Update README.md

fix typo
2018-07-15 12:45:15 -07:00
haya14busa
7c17e85217 fix modifies-parameter name in README (#36) 2018-07-14 18:39:49 -07:00
mgechev
8b99937f99
Update the list of contributors 2018-07-13 15:02:51 -07:00
Markus Wiegand
095a25d375 Add formatter NDJSON (#34)
* Add formatter json-stream

* use new json struct in json-stream

* rename json-stream formatter to ndjson

* add ndjson formatter to readme
2018-07-13 15:01:27 -07:00
Markus Wiegand
1e0238d20a Add severity to json formatter (#33)
* Add severity to json formatter

* Rename struct 'JSONObject'
2018-07-12 20:36:45 -07:00
Markus Wiegand
1cab2ac566 add atom package 'linter-revive' to supported editors (#32) 2018-07-10 20:04:39 -07:00
chavacava
d95910df55 Refactoring: move pick function to rule/utils.go (#30)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* [WIP] fix multiple file test

* draft solution for detecting confusing-names through multiple files

* [WIP] confusing-name multiple files

* clean-up

* draft working version

* cleaner version + more informative messages

* adds check on struct field names

* fix config.go

* clean master

* new ADS rule: newerr

* ADS-print working version

* ads-print final version

* ads-lost-err working version

* confusing-namming: fix tests

* moves pick to rule/utils for better reusability
2018-07-09 03:00:44 +10:00
mgechev
ca24398638
Update README.md 2018-07-07 15:15:12 -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
c2e2dbac85 New rule: unused-parameter (#28)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* [WIP] fix multiple file test

* draft solution for detecting confusing-names through multiple files

* [WIP] confusing-name multiple files

* clean-up

* draft working version

* cleaner version + more informative messages

* adds check on struct field names

* fix config.go

* clean master

* new ADS rule: newerr

* ADS-print working version

* ads-print final version

* ads-lost-err working version

* confusing-namming: fix tests

* unused-parameter: working version

* WIP adds scopes - still imprecise ( eg a:=a is not detected as use)

* w/scopes and more precise

* adds test on structs

* adds test w/ var shadowing

* more precise handling of for/switch statements

* fix check of +=, -=, *= and the like. Adds better support for slices and switchs
2018-07-07 18:40:02 +10:00
chavacava
b8eababb0d New rule: confusing-results (#27)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* clean-up

* fix config.go

* confusing-results working version
2018-07-02 12:09:58 +10:00
chavacava
443bfc9e0b New rule: Confusing naming (#16)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* [WIP] fix multiple file test

* draft solution for detecting confusing-names through multiple files

* [WIP] confusing-name multiple files

* draft working version

* cleaner version + more informative messages

* adds check on struct field names

* confusing-namming: fix tests
2018-07-02 12:05:20 +10:00
chavacava
68deb55492 New rule deep-exit (#26)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* clean-up

* fix config.go

* deep-exit: first working version

* fix pbs from  @mgechev review

* deep-exit: modifies failure message
2018-06-27 06:21:03 +10:00
chavacava
b2532b3c33 New rule: modifies-parameter (#25)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* clean-up

* fix config.go

* working version
2018-06-24 17:26:21 +10:00
chavacava
7e89359269 superfuous-else handles more cases (#24)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* clean-up

* fix config.go

* superflous-else now detects "jumps" caused by functions like os.Exit and log.Fatal
2018-06-24 17:24:50 +10:00
chavacava
f8c1094ecd New rule: get-return (#23)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Adds confusing-naming rule

* adds multifile test

* clean-up

* clean master

* running version

* isGetter now checks for non lowercase characters
2018-06-22 21:21:09 +10:00
mgechev
a1d3163745
Update the list of contributors 2018-06-14 17:31:32 -07:00
Veniamin Krol
83bd86be4f Fix typo in README.md (#21) 2018-06-13 12:35:38 -07: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
chavacava
c9bde6c503 empty-block: ignore checking blocks of funcs and func literals (#17)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table

* Modifies empty-block rule to ignore bodies of
func literals and funcs

* add test cases on functions with a receiver for completeness
2018-06-11 12:08:58 -07:00
Tamir Duberstein
32df8ca880 Avoid false positives when returning interface values (#6)
* Use subtests

* Make unexported-return type check

* Avoid false positives when returning interface values

Fixes #5.
2018-06-11 11:22:33 -07:00
Tamir Duberstein
1b2ffe282e Improve tests (#18)
* Use subtests

* Make unexported-return type check
2018-06-11 11:22:06 -07:00
mgechev
fb3c2d09af
Update list of contributors 2018-06-09 13:18:47 -07:00
mgechev
8198433610
Update readme with vim support 2018-06-08 16:04:26 -07:00
mgechev
1b84ff83dd
Add missing rule in config 2018-06-08 14:22:21 -07:00
chavacava
1fa5046357 Adds new rule empty-block (#14)
* Adds rule superfluous-else (an extension of indent-error-flow)

* initial (non functional) version

* empty-block working version

* adds tests for empty-block rule

* Adds empty-block to the rules table

* code clean-up
2018-06-08 12:41:49 -07:00
mgechev
dc6767b811
Add toc 2018-06-08 10:28:17 -07:00
mgechev
05db4673db
Add list of contributors 2018-06-08 10:24:28 -07:00
chavacava
cbe45ffc79 Adds rule superfluous-else (an extension of indent-error-flow) (#13)
* Adds rule superfluous-else (an extension of indent-error-flow)

* Fix superfluous-else rule struct namming.

* Adds superfuous-else rule to the rules table
2018-06-08 07:06:29 -07:00
Minko Gechev
5a0635ddfd
Merge pull request #11 from paul-at-start/master
Cyan for readability (better contrast)
2018-06-06 11:36:56 -07:00
Paul Stølen
378f2d32b5 Cyan for readability
- Dark blue on black is not very readable on a lot of screens.
2018-06-06 15:23:12 +02:00
Minko Gechev
abf02d70f2
Merge pull request #10 from mgechev/miniko/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2018-06-03 10:59:02 -07:00
Minko Gechev
7d587ab92b
Create CODE_OF_CONDUCT.md 2018-06-03 10:58:53 -07:00
Minko Gechev
e27206765b Update issue templates 2018-06-03 10:58:02 -07:00
Minko Gechev
ccdb1855bd
Merge pull request #9 from mgechev/minko/add-mit-license
License under MIT
2018-06-03 10:52:33 -07:00