Browse Source

refactor: replace lint to revive

update-packer-186
Bo-Yi Wu 6 years ago
parent
commit
fcefc6ea4c
  1. 2
      .drone.yml
  2. 8
      Makefile
  3. 25
      config.toml

2
.drone.yml

@ -14,7 +14,7 @@ pipeline:
pull: true
commands:
- make vet
- make lint
- make revive
- make test-vendor
- make misspell-check
- make test

8
Makefile

@ -41,11 +41,11 @@ errcheck:
fi
errcheck $(PACKAGES)
lint:
@which golint > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u golang.org/x/lint/golint; \
revive:
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/mgechev/revive; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;
revive -config config.toml -exclude=./vendor/... ./... || exit 1
unconvert:
@which unconvert > /dev/null; if [ $$? -ne 0 ]; then \

25
config.toml

@ -0,0 +1,25 @@
ignoreGeneratedHeader = false
severity = "warning"
confidence = 0.8
errorCode = 1
warningCode = 1
[rule.blank-imports]
[rule.context-as-argument]
[rule.context-keys-type]
[rule.dot-imports]
[rule.error-return]
[rule.error-strings]
[rule.error-naming]
[rule.exported]
[rule.if-return]
[rule.increment-decrement]
[rule.var-naming]
[rule.var-declaration]
[rule.package-comments]
[rule.range]
[rule.receiver-naming]
[rule.time-naming]
[rule.unexported-return]
[rule.indent-error-flow]
[rule.errorf]
Loading…
Cancel
Save