mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Merge pull request #1831 from ap-wtioit/master-install_linters_without_sudo
linting: use local scripts to remove sudo need
This commit is contained in:
commit
b4b4538bd3
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -13,6 +13,13 @@ config/opendkim/
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
|
||||||
|
|
||||||
|
#################################################
|
||||||
|
### Linting Tools #############################
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
tools/
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
### Tests #####################################
|
### Tests #####################################
|
||||||
#################################################
|
#################################################
|
||||||
|
|
19
Makefile
19
Makefile
|
@ -62,14 +62,15 @@ eclint:
|
||||||
@ ./test/linting/lint.sh eclint
|
@ ./test/linting/lint.sh eclint
|
||||||
|
|
||||||
install_linters:
|
install_linters:
|
||||||
@ sudo curl -S -L \
|
@ mkdir -p tools
|
||||||
"https://github.com/hadolint/hadolint/releases/download/v$(HADOLINT_VERSION)/hadolint-$(shell uname -s)-$(shell uname -m)" -o /usr/local/bin/hadolint
|
@ curl -S -L \
|
||||||
@ sudo curl -S -L \
|
"https://github.com/hadolint/hadolint/releases/download/v$(HADOLINT_VERSION)/hadolint-$(shell uname -s)-$(shell uname -m)" -o tools/hadolint
|
||||||
|
@ curl -S -L \
|
||||||
"https://github.com/koalaman/shellcheck/releases/download/v$(SHELLCHECK_VERSION)/shellcheck-v$(SHELLCHECK_VERSION).linux.x86_64.tar.xz" | tar -xJ
|
"https://github.com/koalaman/shellcheck/releases/download/v$(SHELLCHECK_VERSION)/shellcheck-v$(SHELLCHECK_VERSION).linux.x86_64.tar.xz" | tar -xJ
|
||||||
@ sudo curl -S -L \
|
@ curl -S -L \
|
||||||
"https://github.com/editorconfig-checker/editorconfig-checker/releases/download/$(ECLINT_VERSION)/ec-linux-amd64.tar.gz" | tar -xaz
|
"https://github.com/editorconfig-checker/editorconfig-checker/releases/download/$(ECLINT_VERSION)/ec-linux-amd64.tar.gz" | tar -xaz
|
||||||
@ sudo chmod +rx /usr/local/bin/hadolint
|
@ chmod +rx tools/hadolint
|
||||||
@ sudo mv "shellcheck-v$(SHELLCHECK_VERSION)/shellcheck" /usr/bin/
|
@ mv "shellcheck-v$(SHELLCHECK_VERSION)/shellcheck" tools/
|
||||||
@ sudo mv bin/ec-linux-amd64 /usr/bin/eclint
|
@ mv bin/ec-linux-amd64 tools/eclint
|
||||||
@ sudo chmod +x /usr/bin/eclint
|
@ chmod +x tools/eclint
|
||||||
@ sudo rm -rf "shellcheck-v$(SHELLCHECK_VERSION)" bin
|
@ rm -rf "shellcheck-v$(SHELLCHECK_VERSION)" bin
|
||||||
|
|
|
@ -116,7 +116,7 @@ function _shellcheck
|
||||||
{
|
{
|
||||||
local SCRIPT='SHELLCHECK'
|
local SCRIPT='SHELLCHECK'
|
||||||
local ERR=0
|
local ERR=0
|
||||||
local LINT=(/usr/bin/shellcheck -x -S style -Cauto -o all -e SC2154 -W 50)
|
local LINT=(shellcheck -x -S style -Cauto -o all -e SC2154 -W 50)
|
||||||
|
|
||||||
if ! __in_path "${LINT[0]}"
|
if ! __in_path "${LINT[0]}"
|
||||||
then
|
then
|
||||||
|
@ -200,4 +200,8 @@ function _main
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# prefer linters installed in tools
|
||||||
|
PATH="$(pwd)/tools:${PATH}"
|
||||||
|
export PATH
|
||||||
|
|
||||||
_main "${@}" || exit ${?}
|
_main "${@}" || exit ${?}
|
||||||
|
|
Loading…
Reference in a new issue