Skip to content

Commit

Permalink
refactor: update scanner, scanner tests, mockfs
Browse files Browse the repository at this point in the history
closes #165
closes #163
  • Loading branch information
sentriz committed Nov 6, 2021
1 parent b07b9a8 commit fa587fc
Show file tree
Hide file tree
Showing 64 changed files with 3,331 additions and 2,235 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly-release.yaml
@@ -1,7 +1,7 @@
name: Nightly Release
on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
workflow_dispatch: {}
jobs:
test:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.40.0
version: v1.42.1
skip-go-installation: true
- name: Test
run: go test ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.40.0
version: v1.42.1
skip-go-installation: true
- name: Test
run: go test ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.40.0
version: v1.42.1
skip-go-installation: true
- name: Test
run: go test ./...
86 changes: 40 additions & 46 deletions .golangci.yml
@@ -1,57 +1,51 @@
run:
skip-dirs:
- server/assets
- server/assets
skip-dirs-use-default: true

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exportloopref
- gochecknoglobals
- gochecknoinits
- goconst
- gocritic
- gocyclo
- goerr113
- golint
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- varcheck

issues:
exclude-rules:
- path: _test\.go
linters:
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exportloopref
- gochecknoglobals
- text: "weak cryptographic primitive"
linters:
- gosec
- text: "weak random number generator"
linters:
- gochecknoinits
- goconst
- gocritic
- gocyclo
- goerr113
- goprintffuncname
- gosec

# TODO: fix these
- text: "should have comment"
linters:
- golint
- text: "at least one file in a package should have a package comment"
linters:
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- revive
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- varcheck

issues:
exclude-rules:
- path: _test\.go
linters:
- errcheck
- gochecknoglobals
- text: "weak cryptographic primitive"
linters:
- gosec
- text: "weak random number generator"
linters:
- gosec
- text: "at least one file in a package should have a package comment"
linters:
- stylecheck
7 changes: 3 additions & 4 deletions cmd/gonic/gonic.go
Expand Up @@ -86,7 +86,7 @@ func main() {
}
}

db, err := db.New(*confDBPath)
dbc, err := db.New(*confDBPath, db.DefaultOptions())
if err != nil {
log.Fatalf("error opening database: %v\n", err)
}
Expand All @@ -106,8 +106,7 @@ func main() {
JukeboxEnabled: *confJukeboxEnabled,
})
if err != nil {
log.Printf("error creating server: %v\n", err)
return
log.Panicf("error creating server: %v\n", err)
}

var g run.Group
Expand All @@ -123,6 +122,6 @@ func main() {
}

if err := g.Run(); err != nil {
log.Printf("error in job: %v", err)
log.Panicf("error in job: %v", err)
}
}
51 changes: 0 additions & 51 deletions gen_handler_tests

This file was deleted.

29 changes: 13 additions & 16 deletions go.mod
Expand Up @@ -9,9 +9,8 @@ require (
github.com/cespare/xxhash v1.1.0
github.com/disintegration/imaging v1.6.2
github.com/dustin/go-humanize v1.0.0
github.com/faiface/beep v1.0.3-0.20210817042730-1c98bf641535
github.com/google/uuid v1.1.2 // indirect
github.com/gopherjs/gopherwasm v1.0.0 // indirect
github.com/faiface/beep v1.1.0
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0
github.com/gorilla/securecookie v1.1.1
github.com/gorilla/sessions v1.2.1
Expand All @@ -21,23 +20,21 @@ require (
github.com/jinzhu/gorm v1.9.16
github.com/josephburnett/jd v0.0.0-20191228205456-aa1a7c66b42f
github.com/karrick/godirwalk v1.16.1
github.com/kr/pretty v0.1.0 // indirect
github.com/mewkiz/pkg v0.0.0-20200702171441-dd47075182ea // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/mmcdole/gofeed v1.1.0
github.com/matryer/is v1.4.0
github.com/mewkiz/pkg v0.0.0-20211102230744-16a6ce8f1b77 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mmcdole/gofeed v1.1.3
github.com/mmcdole/goxpp v0.0.0-20200921145534-2f3784f67354 // indirect
github.com/nicksellen/audiotags v0.0.0-20160226222119-94015fa599bd
github.com/oklog/run v1.1.0
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c
github.com/peterbourgon/ff v1.7.0
github.com/pkg/errors v0.9.1 // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be
github.com/wader/gormstore v0.0.0-20200328121358-65a111a20c23
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect
golang.org/x/exp v0.0.0-20201229011636-eab1b5eb1a03 // indirect
golang.org/x/image v0.0.0-20201208152932-35266b937fa6 // indirect
golang.org/x/sys v0.0.0-20201223074533-0d417f636930 // indirect
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
github.com/wader/gormstore v0.0.0-20211009162750-8bf4f5606ef4
golang.org/x/exp v0.0.0-20211103171733-83d51122435b // indirect
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 // indirect
golang.org/x/mobile v0.0.0-20211103151657-e68c98865fb2 // indirect
golang.org/x/net v0.0.0-20211104170005-ce137452f963 // indirect
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b // indirect
gopkg.in/gormigrate.v1 v1.6.0
)

0 comments on commit fa587fc

Please sign in to comment.