From b92db25e6aee4f7f09896f7ed4d52151c7a7b250 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Mon, 23 Aug 2021 18:10:36 +0300 Subject: [PATCH] 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 Date: Mon Aug 23 17:57:59 2021 +0300 scripts: imp linter scripts --- internal/tools/tools.go | 1 + scripts/make/go-lint.sh | 8 ++++++-- scripts/make/txt-lint.sh | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/tools/tools.go b/internal/tools/tools.go index 7d875da1..214301bf 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -4,6 +4,7 @@ package tools import ( + // Tools. _ "github.com/fzipp/gocyclo/cmd/gocyclo" _ "github.com/golangci/misspell/cmd/misspell" _ "github.com/gordonklaus/ineffassign" diff --git a/scripts/make/go-lint.sh b/scripts/make/go-lint.sh index 81fcc706..0845acb3 100644 --- a/scripts/make/go-lint.sh +++ b/scripts/make/go-lint.sh @@ -49,9 +49,12 @@ trap not_found EXIT # Warnings +go_version="$( "$GO" version )" +readonly go_version + go_min_version='go1.16' 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. for example: @@ -59,7 +62,8 @@ for example: " readonly go_min_version go_version_msg -case "$( "$GO" version )" + +case "$go_version" in ('go version'*"$go_min_version"*) # Go on. diff --git a/scripts/make/txt-lint.sh b/scripts/make/txt-lint.sh index ab67d33a..aa959506 100644 --- a/scripts/make/txt-lint.sh +++ b/scripts/make/txt-lint.sh @@ -46,4 +46,5 @@ not_found() { } 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