diff options
author | Linus Groh <mail@linusgroh.de> | 2020-12-27 15:34:06 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-27 21:25:27 +0100 |
commit | 51bcfb5a44ebedc319bb8dc66dfe814f936e5e83 (patch) | |
tree | c47b89dfcbad76f4416eeb3e87768203e9be2720 /Meta/lint-ci.sh | |
parent | a56b3cbf7cb7968e9eac93272b829002dd36ce15 (diff) | |
download | serenity-51bcfb5a44ebedc319bb8dc66dfe814f936e5e83.zip |
Meta: Update lint-{clang-format,shell-scripts}.sh to take a list of files
This should speed up pre-commit a bit as only files that are staged will
be processed, and clang-format and shellcheck are only invoked once, not
for every file. When no arguments are given (e.g. on CI), it still uses
'git ls-files'.
Diffstat (limited to 'Meta/lint-ci.sh')
-rwxr-xr-x | Meta/lint-ci.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Meta/lint-ci.sh b/Meta/lint-ci.sh index d3ba23de2e..bf4cbbedc7 100755 --- a/Meta/lint-ci.sh +++ b/Meta/lint-ci.sh @@ -20,17 +20,17 @@ for cmd in \ Meta/lint-executable-resources.sh \ Meta/lint-ipc-ids.sh \ Meta/lint-shell-scripts.sh; do - echo "Running $cmd... " - if $cmd; then - echo -e "[${GREEN}OK${NC}]: ${cmd}" + echo "Running ${cmd}... " + if "${cmd}" "$@"; then + echo -e "[${GREEN}OK${NC}]: ${cmd}" else - echo -e "[${RED}FAIL${NC}]: ${cmd}" - ((FAILURES+=1)) + echo -e "[${RED}FAIL${NC}]: ${cmd}" + ((FAILURES+=1)) fi done echo "Running Meta/lint-clang-format.sh" -if Meta/lint-clang-format.sh --overwrite-inplace && git diff --exit-code; then +if Meta/lint-clang-format.sh --overwrite-inplace "$@" && git diff --exit-code; then echo -e "[${GREEN}OK${NC}]: Meta/lint-clang-format.sh" else echo -e "[${RED}FAIL${NC}]: Meta/lint-clang-format.sh" |