From 36d1fde031f72ce3b8ae907c95a10cd5be96390b Mon Sep 17 00:00:00 2001 From: Mykyta Solomko Date: Fri, 7 May 2021 02:23:00 +0300 Subject: [PATCH 1/3] Switched to linter plugin --- .ci/lint-shell.sh | 17 ----------------- .ci/lint-yaml.sh | 14 -------------- .woodpecker.yml | 18 ++++++++++-------- .ci/yamllint.yml => .yamllint.yml | 0 4 files changed, 10 insertions(+), 39 deletions(-) delete mode 100755 .ci/lint-shell.sh delete mode 100755 .ci/lint-yaml.sh rename .ci/yamllint.yml => .yamllint.yml (100%) diff --git a/.ci/lint-shell.sh b/.ci/lint-shell.sh deleted file mode 100755 index 0a7d84d..0000000 --- a/.ci/lint-shell.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -RET=0 - -CUR_DIR=$(pwd) -SHELL_FILES=".bash_profile .bashrc" -SHELL_FILES="${SHELL_FILES} $(find \"${CUR_DIR}\" -type f -name '*.sh')" - -for SH_F in ${SHELL_FILES[*]}; do - shellcheck --color=always \ - --severity=style \ - "${SH_F}" \ - || RET=${?} -done - -exit ${RET} - diff --git a/.ci/lint-yaml.sh b/.ci/lint-yaml.sh deleted file mode 100755 index 89af0b4..0000000 --- a/.ci/lint-yaml.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -RET=0 - -CUR_DIR=$(pwd) -YAML_FILES=$(find "${CUR_DIR}" -type f \( -iname '*.yml' -or -iname '*.yaml' \)) - -for YM_F in ${YAML_FILES[*]}; do - yamllint -c "${CUR_DIR}/.ci/yamllint.yml" "${YM_F}" \ - || RET=${?} -done - -exit ${RET} - diff --git a/.woodpecker.yml b/.woodpecker.yml index 97e40b3..5a70423 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,18 +1,20 @@ --- pipeline: lint-shell: - image: koalaman/shellcheck-alpine:stable + image: sevoid/linter:plugin + pull: always group: lint - commands: - - apk add --no-cache bash - - bash ./.ci/lint-shell.sh + lint: shell + files: + - ".bashrc" + - ".bash_profile" + - ".bash_aliases" lint-yaml: - image: sdesbure/yamllint:latest + image: sevoid/linter:plugin + pull: always group: lint - commands: - - apk add --no-cache bash - - bash ./.ci/lint-yaml.sh + lint: yaml branches: exlude: [ master ] diff --git a/.ci/yamllint.yml b/.yamllint.yml similarity index 100% rename from .ci/yamllint.yml rename to .yamllint.yml -- 2.17.6 From ff773449f38ad688dd30f737984d3913759dee44 Mon Sep 17 00:00:00 2001 From: Mykyta Solomko Date: Fri, 7 May 2021 02:24:47 +0300 Subject: [PATCH 2/3] pull: always => pull: true --- .woodpecker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 5a70423..16fb721 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -2,7 +2,7 @@ pipeline: lint-shell: image: sevoid/linter:plugin - pull: always + pull: true group: lint lint: shell files: @@ -12,7 +12,7 @@ pipeline: lint-yaml: image: sevoid/linter:plugin - pull: always + pull: true group: lint lint: yaml -- 2.17.6 From 0a21c0d690c2072b0bf4ad5a4d83cac6a7b6eab3 Mon Sep 17 00:00:00 2001 From: Mykyta Solomko Date: Fri, 7 May 2021 02:30:46 +0300 Subject: [PATCH 3/3] Added .shellcheckrc --- .shellcheckrc | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..4c9f5bc --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,9 @@ +shell=bash +color=always +severity=error +# Ignore missing shebang +disable=SC2148 +# Ignore slackware's ${LS_OPTIONS} +disable=SC2139 +# Don't follow includes +disable=SC1091 -- 2.17.6