enable some more linters

This commit is contained in:
Michael McLoughlin
2018-12-05 00:49:12 -08:00
parent fa18d7229f
commit 00c50be004
4 changed files with 29 additions and 2 deletions

23
.golangci.yml Normal file
View File

@@ -0,0 +1,23 @@
linters:
enable-all: false
enable:
- structcheck
- varcheck
- ineffassign
- typecheck
- megacheck
- deadcode
- govet
- errcheck
- goimports
- depguard
- goconst
- unconvert
- gocritic
linters-settings:
depguard:
list-type: whitelist
packages:
- github.com/mmcloughlin/avo
- golang.org/x/arch/x86

View File

@@ -1,6 +1,8 @@
language: go
go:
- 1.11.1
install:
- ./script/bootstrap
script:
- ./script/lint
- go test ./...

View File

@@ -374,8 +374,7 @@ func operand(op opcodesxml.Operand) inst.Operand {
func datasize(f opcodesxml.Form) int {
// Determine from encoding bits.
e := f.Encoding
switch {
case e.VEX != nil && e.VEX.W == nil:
if e.VEX != nil && e.VEX.W == nil {
return 128 << e.VEX.L
}

View File

@@ -3,3 +3,6 @@
# Ensure the repository is clean after code generation.
./script/generate
test -z "$(git status --porcelain)"
# Run suite of golangci-lint checks.
golangci-lint run