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 1, 2021
1 parent c31b3b8 commit 746b142
Show file tree
Hide file tree
Showing 64 changed files with 3,163 additions and 2,165 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Nightly Release
on:
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
workflow_dispatch: {}
jobs:
test:
Expand All @@ -13,15 +13,15 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Install dependencies
run: |
sudo apt update -qq
sudo apt install -y -qq build-essential git sqlite libtag1-dev ffmpeg libasound-dev zlib1g-dev
- 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
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Install dependencies
run: |
sudo apt update -qq
sudo apt install -y -qq build-essential git sqlite libtag1-dev ffmpeg libasound-dev zlib1g-dev
- 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
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.17.x
- name: Install dependencies
run: |
sudo apt update -qq
sudo apt install -y -qq build-essential git sqlite libtag1-dev ffmpeg libasound-dev zlib1g-dev
- 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
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion cmd/gonic/gonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func main() {
}
}

db, err := db.New(*confDBPath)
db, err := db.New(*confDBPath, db.DefaultOptions())
if err != nil {
log.Fatalf("error opening database: %v\n", err)
}
Expand Down
51 changes: 0 additions & 51 deletions gen_handler_tests

This file was deleted.

47 changes: 31 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,58 @@
module go.senan.xyz/gonic

go 1.16
go 1.17

require (
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
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/gorilla/mux v1.8.0
github.com/gorilla/securecookie v1.1.1
github.com/gorilla/sessions v1.2.1
github.com/hajimehoshi/go-mp3 v0.3.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
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/matryer/is v1.4.0
github.com/mmcdole/gofeed v1.1.0
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
gopkg.in/gormigrate.v1 v1.6.0
)

require (
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/PuerkitoBio/goquery v1.5.1 // indirect
github.com/andybalholm/cascadia v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/hajimehoshi/go-mp3 v0.3.1 // indirect
github.com/hajimehoshi/oto v0.7.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/icza/bitio v1.0.0 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/mewkiz/flac v1.0.7 // 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/goxpp v0.0.0-20181012175147-0068e33feabf // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
github.com/pkg/errors v0.9.1 // indirect
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/mobile v0.0.0-20201217150744-e6ae53a27f4f // indirect
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // 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
gopkg.in/gormigrate.v1 v1.6.0
golang.org/x/text v0.3.2 // indirect
)
Loading

0 comments on commit 746b142

Please sign in to comment.