File tree 6 files changed +12
-13
lines changed
6 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 1
1
OUT_DIR := ./out
2
2
GO_FILES := $(shell find . -type f \( -iname '* .go' \) )
3
+ GO_MODULE := github.com/eikendev/hackenv
3
4
4
5
SCRIPT_FILES := $(wildcard ./bin/* )
5
6
@@ -14,17 +15,18 @@ clean:
14
15
15
16
.PHONY : test
16
17
test : lint_scripts
17
- stdout=$$(gofumpt -l . 2>&1 ) ; if [ " $$ stdout" ]; then exit 1; fi
18
+ if [ -n " $$ (gofumpt -l $( GO_FILES) )" ]; then echo " Code is not properly formatted" ; exit 1; fi
19
+ if [ -n " $$ (goimports -l -local $( GO_MODULE) $( GO_FILES) )" ]; then echo " Imports are not properly formatted" ; exit 1; fi
18
20
go vet ./...
19
21
misspell -error $(GO_FILES )
20
22
gocyclo -over 10 $(GO_FILES )
21
23
staticcheck ./...
22
- errcheck ./...
24
+ errcheck -ignoregenerated ./...
23
25
gocritic check -disable=' #experimental,#opinionated' -@ifElseChain.minThreshold 3 ./...
24
26
revive -set_exit_status ./...
25
27
nilaway ./...
26
28
go test -v -cover ./...
27
- gosec -exclude-dir=tests ./...
29
+ gosec -exclude-generated ./...
28
30
govulncheck ./...
29
31
@printf ' \n%s\n' " > Test successful"
30
32
37
39
go install github.com/mgechev/revive@latest
38
40
go install github.com/securego/gosec/v2/cmd/gosec@latest
39
41
go install go.uber.org/nilaway/cmd/nilaway@latest
42
+ go install golang.org/x/tools/cmd/goimports@latest
40
43
go install golang.org/x/vuln/cmd/govulncheck@latest
41
44
go install honnef.co/go/tools/cmd/staticcheck@latest
42
45
go install mvdan.cc/gofumpt@latest
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ import (
5
5
"os/exec"
6
6
"strings"
7
7
8
+ log "github.com/sirupsen/logrus"
9
+
8
10
"github.com/eikendev/hackenv/internal/options"
9
11
"github.com/eikendev/hackenv/internal/scripts"
10
- log "github.com/sirupsen/logrus"
11
12
)
12
13
13
14
// FixCommand represents the options specific to the fix command.
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ import (
7
7
"regexp"
8
8
"time"
9
9
10
+ "github.com/adrg/xdg"
10
11
log "github.com/sirupsen/logrus"
12
+ rawLibvirt "libvirt.org/go/libvirt"
11
13
12
- "github.com/adrg/xdg"
13
14
"github.com/eikendev/hackenv/internal/constants"
14
- rawLibvirt "libvirt.org/go/libvirt"
15
15
)
16
16
17
17
type infoRetriever func (string , * regexp.Regexp ) (* DownloadInfo , error )
Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ import (
5
5
"errors"
6
6
7
7
log "github.com/sirupsen/logrus"
8
+ "libvirt.org/go/libvirt"
8
9
9
10
"github.com/eikendev/hackenv/internal/constants"
10
11
"github.com/eikendev/hackenv/internal/images"
11
- "libvirt.org/go/libvirt"
12
12
)
13
13
14
14
var domainStates = map [libvirt.DomainState ]string {
Original file line number Diff line number Diff line change 7
7
"os/exec"
8
8
"path/filepath"
9
9
10
+ "github.com/adrg/xdg"
10
11
log "github.com/sirupsen/logrus"
11
12
12
- "github.com/adrg/xdg"
13
13
"github.com/eikendev/hackenv/internal/constants"
14
14
)
15
15
You can’t perform that action at this time.
0 commit comments