diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-11-30 05:21:27 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-11-30 05:21:53 -0500 |
| commit | 68c8b13abb6b52b1745feca3031decdb4d93bacb (patch) | |
| tree | c98ba2e9edb2a4d31b0fa069842bc4a30e6c2f38 /pre-commit-sbolint | |
| parent | b512a44db0e8d276edaada569966bf37b513ef41 (diff) | |
| download | sbo-maintainer-tools-68c8b13abb6b52b1745feca3031decdb4d93bacb.tar.gz | |
Move hooks to hooks/.
Diffstat (limited to 'pre-commit-sbolint')
| -rw-r--r-- | pre-commit-sbolint | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/pre-commit-sbolint b/pre-commit-sbolint deleted file mode 100644 index 1a0c796..0000000 --- a/pre-commit-sbolint +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# 20220315 bkw: SBo pre-commit hook, wrapper for sbolint. -# 20260919 bkw: no code changes; update install comments. - -# Installation: - -# This file is part of sbo-maintainer-tools, which you can get -# from SBo: -# https://slackbuilds.org/repository/15.0/system/sbo-maintainer-tools/ - -# Copy this file to <gitdir>/.git/hooks, mode 0755 (or anyway, make it -# executable). - -# Usage: - -# Just do your usual "git commit". When you do, sbolint will run on -# the build you're updating. If it finds any issues, it will cause the -# commit to abort, so you can fix whatever's wrong and try the commit -# again. - -# Since sbolint isn't perfect, you can skip the check for any commit -# by running e.g: - -# SBOLINT=no git commit <arguments> - -# You can also run sbolint by itself, and read its documentation with -# "sbolint --docs". - -set -e -exec 1>&2 - -# There should normally only be one changed build per commit, but this -# rule may get broken when the repo's frozen pending a new Slackware -# release. So use a loop. - -# The weird-looking "< <(command)" syntax is why this script must -# have a #!/bin/bash at the top: it won't work with #!/bin/sh, even if -# /bin/sh is a symlink to bash. - -if [ "${SBOLINT:-yes}" = "yes" ]; then - sbolintfailed="" - if ! which sbolint &>/dev/null; then - echo "WARNING: can't find sbolint in PATH, no linting will be done" - else - while read build; do - # if there's no slack-desc or README, assume the build has been removed. - # the directory still might exist after a "git rm -rf" because it - # might contain untracked files (e.g. the source tarball). - if [ -e "$build/slack-desc" -o -e "$build/README" ]; then - sbolint "$build" || sbolintfailed=1 - fi - done < <(git diff --cached --name-only | cut -d/ -f1,2 | sort -u) - fi - if [ -n "$sbolintfailed" ]; then - echo "*** sbolint failed, fix the errors or set SBOLINT=no" - echo "*** in the environment to commit anyway." - exit 1 - fi -fi - -exit 0 |
