mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
replace gometalinter with golangci-lint (#596)
Former-commit-id: f43cff5a88f9b70f593cf612832428f71decd92f [formerly 7f5f957bc17fb9e03b37224a1cc31ad65af5468c] [formerly 8e8a054716b10a3999bf75deea0f0d3759c1ac42 [formerly 835c37d1e3
]]
Former-commit-id: 970cbb1ad8489d7117ee580339709a07652def96 [formerly f7a47fc1f409b3acc390fa039c0076b208931748]
Former-commit-id: ec3c2df078a903c6485dd74207e34bab08f1d9c1
This commit is contained in:
parent
901dc2c160
commit
74e93b8df0
20
.golangci.yml
Normal file
20
.golangci.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
run:
|
||||||
|
deadline: 5m
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- deadcode
|
||||||
|
- govet
|
||||||
|
- ineffassign
|
||||||
|
- interfacer
|
||||||
|
- maligned
|
||||||
|
- megacheck
|
||||||
|
- structcheck
|
||||||
|
- unconvert
|
||||||
|
- varcheck
|
||||||
|
enable-all: false
|
||||||
|
disable-all: true
|
||||||
|
# presets:
|
||||||
|
# - bugs
|
||||||
|
# - unused
|
||||||
|
fast: false
|
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"Enable": [
|
|
||||||
"deadcode",
|
|
||||||
"gotype",
|
|
||||||
"gotypex",
|
|
||||||
"ineffassign",
|
|
||||||
"interfacer",
|
|
||||||
"maligned",
|
|
||||||
"megacheck",
|
|
||||||
"structcheck",
|
|
||||||
"unconvert",
|
|
||||||
"varcheck",
|
|
||||||
"vet"
|
|
||||||
],
|
|
||||||
"Disable": [
|
|
||||||
"dupl",
|
|
||||||
"errcheck",
|
|
||||||
"gochecknoglobals",
|
|
||||||
"gochecknoinits",
|
|
||||||
"goconst",
|
|
||||||
"gocyclo",
|
|
||||||
"gofmt",
|
|
||||||
"goimports",
|
|
||||||
"golint",
|
|
||||||
"gosec",
|
|
||||||
"gosimple",
|
|
||||||
"lll",
|
|
||||||
"misspell",
|
|
||||||
"nakedret",
|
|
||||||
"safesql",
|
|
||||||
"staticcheck",
|
|
||||||
"test",
|
|
||||||
"testify",
|
|
||||||
"unparam",
|
|
||||||
"unused",
|
|
||||||
"vetshadow"
|
|
||||||
]
|
|
||||||
}
|
|
@ -20,7 +20,7 @@ cache:
|
|||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: lint
|
- stage: lint
|
||||||
script: "./build/run_gometalinter.sh"
|
script: "./build/run_linters.sh"
|
||||||
- stage: test
|
- stage: test
|
||||||
script: "./build/build_all.sh"
|
script: "./build/build_all.sh"
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -17,8 +17,7 @@ if [ "$USE_DOCKER" != "" ]; then
|
|||||||
COMMIT_SHA="untracked"
|
COMMIT_SHA="untracked"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$(command -v winpty) docker run -it \
|
$(command -v winpty) docker run --rm -it \
|
||||||
--name filebrowser-tmp \
|
|
||||||
-v /$(pwd):/src:z \
|
-v /$(pwd):/src:z \
|
||||||
-w //src \
|
-w //src \
|
||||||
-e COMMIT_SHA=$COMMIT_SHA \
|
-e COMMIT_SHA=$COMMIT_SHA \
|
||||||
@ -30,18 +29,6 @@ if [ "$USE_DOCKER" != "" ]; then
|
|||||||
./build_assets.sh && \
|
./build_assets.sh && \
|
||||||
./build.sh \
|
./build.sh \
|
||||||
"
|
"
|
||||||
exitcode=$?
|
|
||||||
|
|
||||||
if [ $exitcode -eq 0 ]; then
|
|
||||||
for d in "dist/" "node_modules/"; do
|
|
||||||
docker cp filebrowser-tmp://src/frontend/$d frontend
|
|
||||||
done
|
|
||||||
docker cp filebrowser-tmp://src/cli/filebrowser ./filebrowser
|
|
||||||
docker cp filebrowser-tmp://src/lib/rice-box.go ./lib/rice-box.go
|
|
||||||
else
|
|
||||||
echo "BUILD FAILED!"
|
|
||||||
fi
|
|
||||||
docker rm -f filebrowser-tmp
|
|
||||||
else
|
else
|
||||||
set -e
|
set -e
|
||||||
./build/build_assets.sh
|
./build/build_assets.sh
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cd $(dirname $0)/..
|
|
||||||
|
|
||||||
dolint='gometalinter --exclude="rice-box.go" --exclude="vendor" --deadline=300s ./...'
|
|
||||||
|
|
||||||
WDIR="/go/src/github.com/filebrowser/filebrowser"
|
|
||||||
|
|
||||||
if [ "$USE_DOCKER" != "" ]; then
|
|
||||||
$(command -v winpty) docker run --rm -itv "/$(pwd):/$WDIR" -w "/$WDIR" filebrowser/dev sh -c "\
|
|
||||||
GO111MODULE=on go get -v ./... && \
|
|
||||||
GO111MODULE=on go mod vendor && \
|
|
||||||
GO111MODULE=off $dolint"
|
|
||||||
else
|
|
||||||
$dolint
|
|
||||||
fi
|
|
13
build/run_linters.sh
Executable file
13
build/run_linters.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd $(dirname $0)/..
|
||||||
|
|
||||||
|
if [ "$USE_DOCKER" != "" ]; then
|
||||||
|
$(command -v winpty) docker run --rm -itv "/$(pwd)://src" -w "//src" filebrowser/dev sh -c "\
|
||||||
|
go get -v ./... && \
|
||||||
|
golangci-lint run -v"
|
||||||
|
else
|
||||||
|
golangci-lint run -v
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user