mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-22 14:23:53 -07:00
Merge c9c8de525d
into a06d7c1841
This commit is contained in:
commit
a7bea46ef6
4 changed files with 19 additions and 19 deletions
|
@ -11,3 +11,6 @@ do
|
|||
last=$(grep -hv "^prop" ./**/*.hs | grep -Ewo "$i[0-9]{3}" | sort -n | tail -n 1)
|
||||
echo "Next ${i}xxx: $((last+1))"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
4
quickrun
4
quickrun
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# quickrun runs ShellCheck in an interpreted mode.
|
||||
# This allows testing changes without recompiling.
|
||||
|
||||
runghc -isrc -idist/build/autogen shellcheck.hs "$@"
|
||||
|
||||
exit
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# quicktest runs the ShellCheck unit tests in an interpreted mode.
|
||||
# This allows running tests without compiling, which can be faster.
|
||||
# 'cabal test' remains the source of truth.
|
||||
|
@ -16,7 +16,7 @@ if [[ $var == *$'\nTrue'* ]]
|
|||
then
|
||||
exit 0
|
||||
else
|
||||
grep -C 3 -e "Fail" -e "Tracing" <<< "$var"
|
||||
grep -C 3 -e "Fail" -e "Tracing" <<< "${var}"
|
||||
exit 1
|
||||
fi
|
||||
) 2>&1
|
||||
|
|
27
striptests
27
striptests
|
@ -5,15 +5,14 @@
|
|||
set -o pipefail
|
||||
|
||||
sponge() {
|
||||
data="$(cat)"
|
||||
printf '%s\n' "$data" > "$1"
|
||||
local -r DATA="$(cat)"
|
||||
printf '%s\n' "${DATA}" > "${1}"
|
||||
}
|
||||
|
||||
modify() {
|
||||
if ! "${@:2}" < "$1" | sponge "$1"
|
||||
then
|
||||
if ! "${@:2}" < "${1}" | sponge "${1}"
|
||||
{
|
||||
printf 'Failed to modify %s: ' "$1"
|
||||
printf 'Failed to modify %s: ' "${1}"
|
||||
printf '%q ' "${@:2}"
|
||||
printf '\n'
|
||||
} >&2
|
||||
|
@ -50,28 +49,24 @@ detestify() {
|
|||
'
|
||||
}
|
||||
|
||||
|
||||
|
||||
if [[ ! -e ShellCheck.cabal ]]
|
||||
if [[ ! -e 'ShellCheck.cabal' ]]
|
||||
then
|
||||
echo "Run me from the ShellCheck directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d '.git' ]] && ! git diff --exit-code > /dev/null 2>&1
|
||||
then
|
||||
if [[ -d '.git' ]] && ! git diff --exit-code > /dev/null 2>&1; then
|
||||
echo "You have local changes! These may be overwritten." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
modify ShellCheck.cabal sed -e '
|
||||
modify 'ShellCheck.cabal' sed -e '
|
||||
/QuickCheck/d
|
||||
/^test-suite/{ s/.*//; q; }
|
||||
'
|
||||
|
||||
find . -name '.git' -prune -o -type f -name '*.hs' -print |
|
||||
while IFS= read -r file
|
||||
do
|
||||
modify "$file" detestify
|
||||
done
|
||||
while IFS= read -r file; do
|
||||
modify "${file}" detestify
|
||||
done < <(find . -name '.git' -prune -o -type f -name '*.hs' -print)
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue