Change lint options

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2019-07-10 15:35:00 +02:00
parent 898454ca9a
commit 8cd484a8b0
3 changed files with 12 additions and 5 deletions

View File

@ -89,7 +89,7 @@ jobs:
command: |
bash <(curl -s https://codecov.io/bash)
lint:
lint: &lint
description: |
Run golangci-lint.
parameters:
@ -124,15 +124,20 @@ jobs:
command: |
golangci-lint run -v \
--concurrency << parameters.concurrency >> << parameters.args >>
lint-changes:
<<: *lint
lint-all:
<<: *lint
workflows:
version: 2
ci:
jobs:
- lint
- lint:
args: "--no-config --exclude-use-default=false --disable-all --enable golint"
- lint-changes:
args: "--new-from-rev origin/master"
- lint-all
- test:
codecov-upload: true
- mod-tidy-check

View File

@ -20,7 +20,6 @@ issues:
exclude:
- "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this"
- "Potential file inclusion via variable"
- "should have( a package)? comment"
exclude-use-default: false
exclude-rules:

View File

@ -25,12 +25,14 @@ const (
fsLock = "repo.lock"
)
// FsRepo is struct for repo, use NewFS to create
type FsRepo struct {
path string
}
var _ Repo = &FsRepo{}
// APIEndpoint returns endpoint of API in this repo
func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error) {
p := filepath.Join(fsr.path, fsAPI)
f, err := os.Open(p)
@ -56,6 +58,7 @@ func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error) {
return apima, nil
}
// Lock acquires exclusive lock on this repo
func (fsr *FsRepo) Lock() (LockedRepo, error) {
closer, err := fslock.Lock(fsr.path, fsLock)
if err != nil {