Pull request: scripts: imp linter scripts
Merge in DNS/adguard-home from imp-lint to master Squashed commit of the following: commit f5b5115a225431855798764770423209e03d6020 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Aug 23 17:57:59 2021 +0300 scripts: imp linter scripts
This commit is contained in:
parent
b81030ba70
commit
b92db25e6a
|
@ -4,6 +4,7 @@
|
||||||
package tools
|
package tools
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
// Tools.
|
||||||
_ "github.com/fzipp/gocyclo/cmd/gocyclo"
|
_ "github.com/fzipp/gocyclo/cmd/gocyclo"
|
||||||
_ "github.com/golangci/misspell/cmd/misspell"
|
_ "github.com/golangci/misspell/cmd/misspell"
|
||||||
_ "github.com/gordonklaus/ineffassign"
|
_ "github.com/gordonklaus/ineffassign"
|
||||||
|
|
|
@ -49,9 +49,12 @@ trap not_found EXIT
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
|
|
||||||
|
go_version="$( "$GO" version )"
|
||||||
|
readonly go_version
|
||||||
|
|
||||||
go_min_version='go1.16'
|
go_min_version='go1.16'
|
||||||
go_version_msg="
|
go_version_msg="
|
||||||
warning: your go version is different from the recommended minimal one (${go_min_version}).
|
warning: your go version (${go_version}) is different from the recommended minimal one (${go_min_version}).
|
||||||
if you have the version installed, please set the GO environment variable.
|
if you have the version installed, please set the GO environment variable.
|
||||||
for example:
|
for example:
|
||||||
|
|
||||||
|
@ -59,7 +62,8 @@ for example:
|
||||||
"
|
"
|
||||||
readonly go_min_version go_version_msg
|
readonly go_min_version go_version_msg
|
||||||
|
|
||||||
case "$( "$GO" version )"
|
|
||||||
|
case "$go_version"
|
||||||
in
|
in
|
||||||
('go version'*"$go_min_version"*)
|
('go version'*"$go_min_version"*)
|
||||||
# Go on.
|
# Go on.
|
||||||
|
|
|
@ -46,4 +46,5 @@ not_found() {
|
||||||
}
|
}
|
||||||
trap not_found EXIT
|
trap not_found EXIT
|
||||||
|
|
||||||
git ls-files -- '*.md' '*.yaml' '*.yml' | xargs misspell --error
|
git ls-files -- '*.md' '*.yaml' '*.yml' 'client/src/__locales/en.json'\
|
||||||
|
| xargs misspell --error
|
||||||
|
|
Loading…
Reference in New Issue