mirror of
https://github.com/ben-grande/qusal.git
synced 2025-08-07 05:32:21 -04:00
Fail
This commit is contained in:
parent
6fb526768f
commit
fd1e064178
6 changed files with 51 additions and 12 deletions
5
.github/workflows/main.yaml
vendored
5
.github/workflows/main.yaml
vendored
|
@ -17,7 +17,10 @@ jobs:
|
||||||
- uses: pre-commit/action@v3.0.0
|
- uses: pre-commit/action@v3.0.0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: apt update -y && apt install -y gitlint
|
run: |
|
||||||
|
apt update -y
|
||||||
|
apt install -y python3-dev python3-pip gitlint shellcheck reuse
|
||||||
|
pip3 install salt-lint
|
||||||
- name: Gitlint
|
- name: Gitlint
|
||||||
# yamllint disable-line rule:line-length
|
# yamllint disable-line rule:line-length
|
||||||
run: gitlint --debug --commits ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
run: gitlint --debug --commits ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
|
||||||
|
|
2
.gitlint
2
.gitlint
|
@ -14,7 +14,7 @@ ignore-squash-commits=false
|
||||||
fail-without-commits=true
|
fail-without-commits=true
|
||||||
regex-style-search=true
|
regex-style-search=true
|
||||||
debug=false
|
debug=false
|
||||||
contrib=contrib-title-conventional-commits,contrib-body-requires-signed-off-by
|
contrib=contrib-title-conventional-commits
|
||||||
|
|
||||||
[title-max-length]
|
[title-max-length]
|
||||||
line-length=50
|
line-length=50
|
||||||
|
|
|
@ -10,21 +10,14 @@ repos:
|
||||||
name: salt-lint
|
name: salt-lint
|
||||||
entry: scripts/salt-lint.sh
|
entry: scripts/salt-lint.sh
|
||||||
language: script
|
language: script
|
||||||
pass_filenames: false
|
pass_filenames: true
|
||||||
description: Lint Salt files
|
description: Lint Salt files
|
||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
name: shellcheck
|
name: shellcheck
|
||||||
entry: scripts/shell-lint.sh
|
entry: scripts/shell-lint.sh
|
||||||
language: script
|
language: script
|
||||||
pass_filenames: false
|
pass_filenames: true
|
||||||
description: Lint Shellscripts
|
description: Lint Shellscripts
|
||||||
- id: gitlint
|
|
||||||
name: gitlint
|
|
||||||
language: python
|
|
||||||
entry: gitlint
|
|
||||||
args: [--staged, --msg-filename]
|
|
||||||
stages: [commit-msg]
|
|
||||||
description: Lint Git commits
|
|
||||||
- id: reuse
|
- id: reuse
|
||||||
name: reuse
|
name: reuse
|
||||||
entry: reuse
|
entry: reuse
|
||||||
|
@ -32,3 +25,10 @@ repos:
|
||||||
language: python
|
language: python
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
description: Lint files to comply with the REUSE Specification
|
description: Lint files to comply with the REUSE Specification
|
||||||
|
- id: gitlint
|
||||||
|
name: gitlint
|
||||||
|
language: python
|
||||||
|
entry: gitlint
|
||||||
|
args: [--staged, --msg-filename]
|
||||||
|
stages: [commit-msg]
|
||||||
|
description: Lint Git commits
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
* [Respect](#respect)
|
* [Respect](#respect)
|
||||||
|
|
|
@ -24,9 +24,23 @@ elif command -v fdfind >/dev/null; then
|
||||||
find_tool="fdfind"
|
find_tool="fdfind"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test -n "${1-}"; then
|
||||||
|
files=""
|
||||||
|
for f in "$@"; do
|
||||||
|
test -f "$f" || continue
|
||||||
|
extension="$(echo "$f" | awk -F '.' '{print $NF}')"
|
||||||
|
case "$extension" in
|
||||||
|
top|sls) files="$files $f";;
|
||||||
|
*) continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
test -n "$files" || exit 0
|
||||||
|
exec salt-lint ${conf} ${files}
|
||||||
|
fi
|
||||||
|
|
||||||
case "${find_tool}" in
|
case "${find_tool}" in
|
||||||
fd|fdfind) files="minion.d/qusal.conf $(${find_tool} . qusal/ --max-depth=2 --type=f --extension=sls --extension=top)";;
|
fd|fdfind) files="minion.d/qusal.conf $(${find_tool} . qusal/ --max-depth=2 --type=f --extension=sls --extension=top)";;
|
||||||
find) files="minion.d/qusal.conf $(find qusal/* -maxdepth 2 -type f \( -name '*.sls' -o -name '*.top' \))";;
|
find) files="minion.d/qusal.conf $(find qusal/* -maxdepth 2 -type f \( -name '*.sls' -o -name '*.top' \))";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
salt-lint ${conf} ${files}
|
exec salt-lint ${conf} ${files}
|
||||||
|
|
|
@ -26,6 +26,27 @@ elif command -v fdfind >/dev/null; then
|
||||||
find_tool="fdfind"
|
find_tool="fdfind"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test -n "${1-}"; then
|
||||||
|
files=""
|
||||||
|
sh_files=""
|
||||||
|
for f in "$@"; do
|
||||||
|
test -f "$f" || continue
|
||||||
|
if test "${f##*/}" = "rc.local"; then
|
||||||
|
sh_files="$sh_files $f"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
case $( file -bi "$f" ) in
|
||||||
|
(*/x-shellscript*) files="$files $f";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
if test -n "$files" || test -n "$sh_files"; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
test -z "$files" || shellcheck ${files}
|
||||||
|
test -z "$sh_files" || shellcheck -s sh ${sh_files}
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
case "${find_tool}" in
|
case "${find_tool}" in
|
||||||
fd|fdfind)
|
fd|fdfind)
|
||||||
# shellcheck disable=2016,2215
|
# shellcheck disable=2016,2215
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue