Compare commits

...

1 Commits
master ... ci

Author SHA1 Message Date
Mykyta Solomko a3791b6e00 Added pipeline and scripts 5 years ago
  1. 14
      .ci/lint-python.sh
  2. 17
      .ci/lint-shell.sh
  3. 14
      .ci/lint-yaml.sh
  4. 21
      .ci/yamllint.yml
  5. 23
      .woodpecker.yml

14
.ci/lint-python.sh

@ -0,0 +1,14 @@
#!/usr/bin/env bash
RET=0
CUR_DIR=$(pwd)
PYTHON_FILES=$(find "${CUR_DIR}" -type f -iname '*.py')
for PY_F in ${PYTHON_FILES[*]}; do
pylint "${PY_F}" \
|| RET=${?}
done
exit ${RET}

17
.ci/lint-shell.sh

@ -0,0 +1,17 @@
#!/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}

14
.ci/lint-yaml.sh

@ -0,0 +1,14 @@
#!/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}

21
.ci/yamllint.yml

@ -0,0 +1,21 @@
---
extends: default
rules:
line-length:
max: 256
level: warning
braces:
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 1
level: warning
brackets:
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: 0
max-spaces-inside-empty: 1
level: warning
# vim:set syntax=yaml ts=2 sw=2 et:

23
.woodpecker.yml

@ -0,0 +1,23 @@
---
pipeline:
lint-shell:
image: sevoid/linter:latest
group: lint
commands:
- bash ./.ci/lint-shell.sh
lint-yaml:
image: sevoid/linter:latest
group: lint
commands:
- bash ./.ci/lint-yaml.sh
lint-python:
image: sevoid/linter:latest
group: lint
commands:
- bash ./.ci/lint-python.sh
branches:
exlude: [ master ]
# vim:set syntax=yaml ts=2 sw=2 et:
Loading…
Cancel
Save