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

779 Commits

Author SHA1 Message Date
chavacava
60e1ae4a01
adds checks for protobuf struct tags (#707)
* adds checks for protobuf struct tags

* use actual tag numbers as key instead of strings
removes debug println
2022-07-15 11:15:55 -07:00
chavacava
e9d5b48c19
fix #670 (#708) 2022-07-14 15:15:42 +02:00
hulk
8dd3945eaf
Check whether the tag name is duplicate or not (#706)
* Check whether the tag name is duplicate or not

* - minor refactoring
- continues checking tag even if name is repeated

* adds test cases for duplicated tag names

* adds test case with two tag types (json & yaml)

* Fix allow the same tag name in different tag key

* fix checks on protobuf tag names

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-07-13 20:26:44 +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
renovate[bot]
5caa8cfc63
fix(deps): update github.com/chavacava/garif digest to 9351721 (#702)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-05 09:03:14 +02:00
chavacava
2aac974b5c
fix issue #691 (#700) 2022-06-28 18:14:26 +03:00
renovate[bot]
3f9c0c2175
fix(deps): update github.com/chavacava/garif digest to d6fd61e (#699)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-06-25 09:02:07 +02:00
okhowang
387d7276a1
Make package comment more confident (#694) 2022-06-19 13:21:31 +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
renovate[bot]
76ef1d75d1
fix(deps): update github.com/chavacava/garif digest to 908ad76 (#695)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-18 09:05:04 +02:00
renovate[bot]
bcffce6f81
fix(deps): update module golang.org/x/tools to v0.1.11 (#696)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-06-18 09:04:35 +02:00
Ville Skyttä
4daa573afe
fix(var-naming): set node to package name for underscore in package name (#689)
Setting the entire file AST as the node causes golangci-lint to print
the entire file source as the context, and line and column numbers set
to 1. Point to the package name node instead.

Closes #688
2022-05-23 12:30:25 +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
31fbdb1833
Fix/677 (#678) 2022-04-10 09:06:59 +02:00
Markus Zimmermann
b9814276b6
Remove built-in types that existing only for the Go documentation (#675)
Since these types only exist for documenting Go's standard library there
should be no reason to mark them.

Closes #673
2022-04-08 15:18:18 +02:00
Markus Zimmermann
23828cc39d
Remove debugging output (#672)
Noticed during migration from our heavily modified "go-lint" to "revive" that there is an additional line printed. I am unsure that the convention for this project is on this, we do not allow adding such a call.
2022-04-07 13:05:51 -07:00
renovate[bot]
87f8e2920c
fix(deps): update module github.com/burntsushi/toml to v1.1.0 (#668)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-05 09:30:34 -07:00
4ricci
d2ab719a0e
Makefile: fix VERSION_FLAGS (#667)
Since 1c283837a9 build info variables
are defined in "github.com/mgechev/revive/cli", not "main".

Fixes #666
2022-04-04 15:37:43 +02:00
chavacava
b6c86a274f
fix issue 664 (#665) 2022-03-31 17:40:26 +02: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
fa939adbf0
Adds support for new type alias any in the rule redefines-built-in (#659)
* adds support for any type alias

* adds more representative tests
2022-03-29 10:51:01 +02:00
chavacava
5f6f0eb142
adds usage of revive as third party library (#653) 2022-03-20 12:53:57 +01:00
Bernardo Heynemann
1c283837a9
Allow revive to be called with extra linters (#650)
This change allows revive to be called from main.go
in other libraries and pass in a list of custom
linters to be added to the built-in linters found in config

Co-authored-by: Bernardo Heynemann <bernardo.heynemann@coinbase.com>
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-03-20 09:12:51 +01:00
chavacava
5ce2ff53c0
removes duplicated utility function (#652) 2022-03-18 15:00:41 +01:00
renovate[bot]
61222a1967
fix(deps): update github.com/chavacava/garif digest to 5cad0b5 (#651)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-17 09:51:20 -07:00
renovate[bot]
de50c6ae09
fix(deps): update module golang.org/x/tools to v0.1.10 (#649)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-03-15 10:12:28 -07:00
Bernhard Reisenberger
f335f9792d
range-val-address: improve detection (#647) 2022-03-12 09:32:57 +01:00
subham sarkar
577441d60c
format sources w/ gofumpt (#643)
Signed-off-by: subham sarkar <sarkar.subhams2@gmail.com>
2022-03-02 08:24:55 +01:00
subham sarkar
54d9a09ab5
Incorrect handling of token.{LEQ,GEQ} for constant-logical-expr (#642)
* fix: incorrect handling of token.{LEQ,GEQ} for constant-logical-expr lint

Signed-off-by: subham sarkar <sarkar.subhams2@gmail.com>

* tiny modification in comments

Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2022-02-27 09:37:51 +01:00
chavacava
d4fbc92440
fix issue #637 (#638) 2022-02-15 22:46:24 +01:00
Tom
baa70eb87c
Run go mod tidy to update go.sum (#633)
Co-authored-by: Tom <tommygun731@gmail.com>
2022-02-09 20:55:26 -08:00
Ahmed
58e6243b64
use ghcr.io (#631) 2022-02-09 10:55:00 +01:00
Ahmed
c350076f4e
login to github registry to push docker images (#630) 2022-02-08 10:40:43 +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
Oleg Butuzov
6545203e2d
refactor(cyclomatic): improved message for cyclomatic rule (#629) 2022-01-31 17:33:43 +01:00
renovate[bot]
47ba3e360c
Update module golang.org/x/tools to v0.1.9 (#626)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-28 09:28:57 -08:00
Ludovic Fernandez
47a1cedde5
fix: invalid rule name in error message (#627) 2022-01-27 08:32:08 +01:00
renovate[bot]
8aab7c6042
Update module github.com/BurntSushi/toml to v1 (#620)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-19 12:59:08 -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
Aleksey Bakin
305f6c13d2 var-naming rule: note about initialisms 2021-12-29 23:29:46 -08:00
Renovate Bot
43d0e31c4c Update module golang.org/x/tools to v0.1.8 2021-12-07 09:20:51 -08:00
doniacld
faba17a90f
Fix package check in error-strings rule (#610) (#611)
Co-authored-by: SalvadorC <salvadorcavadini+github@gmail.com>
2021-10-30 08:45:37 +02:00