diff options
author | Yotam Nachum <me@yotam.net> | 2019-11-22 16:45:23 +0200 |
---|---|---|
committer | Yotam Nachum <me@yotam.net> | 2019-11-22 17:28:19 +0200 |
commit | 6f79975ce14da38b1f15e9beb6ec58b16165efb5 (patch) | |
tree | f089946f0da26ae6eae7708371d34393dd4658cb | |
parent | Add an option to specify custom config file (diff) | |
download | shavit-6f79975ce14da38b1f15e9beb6ec58b16165efb5.tar.gz shavit-6f79975ce14da38b1f15e9beb6ec58b16165efb5.zip |
Add more tools to CI linting
-rw-r--r-- | .build.yml | 5 | ||||
-rw-r--r-- | handler.go | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,6 +1,7 @@ image: fedora/latest packages: - go + - tar sources: - https://git.sr.ht/~yotam/go-gemini-server - https://git.sr.ht/~sircmpwn/annotatego @@ -8,8 +9,12 @@ secrets: - f43da1db-697d-4101-8607-e96f574b035a tasks: - lint: | + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 + go get honnef.co/go/tools/cmd/staticcheck cd go-gemini-server go vet + ~/go/bin/staticcheck + ~/go/bin/golangci-lint run - test: | cd go-gemini-server go test @@ -28,7 +28,7 @@ func (h Handler) urlAbsPath(rawURL string) (string, error) { } if !strings.HasPrefix(itemPath, h.cfg.SourceDir) { - return "", gemini.Error{Err: fmt.Errorf("Permission Denied"), Status: gemini.StatusBadRequest} + return "", gemini.Error{Err: fmt.Errorf("permission denied"), Status: gemini.StatusBadRequest} } return itemPath, nil @@ -58,7 +58,7 @@ func (h Handler) getFilePath(rawURL string) (string, error) { return indexPath, nil } - return "", gemini.Error{Err: fmt.Errorf("File Not Found"), Status: gemini.StatusNotFound} + return "", gemini.Error{Err: fmt.Errorf("file not found"), Status: gemini.StatusNotFound} } // Handle implement the gemini.Handler interface by serving files from a given source directory |