Skip to content

Commit

Permalink
fix: disable shellcheck instead of quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
oikarinen committed Dec 19, 2024
1 parent b4473c1 commit b5e760e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
env:
# NOTE: use env to pass the output in order to avoid possible injection attacks
FILES: "${{ steps.files.outputs.added_modified }}"
- name: Lint and format Python with Ruff
uses: astral-sh/ruff-action@v2
- name: Shellcheck
run: shellcheck --severity=error bin/* ./*.sh
- name: Lint and format Python with Ruff
uses: astral-sh/ruff-action@v2

typo:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions bin/git-guilt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ for file in $(git diff --name-only "$@")
do
test -n "$DEBUG" && echo "git blame $file"
# $1 - since $2 - until
git blame "$NOT_WHITESPACE" --line-porcelain "$1" -- "$file" 2> /dev/null |
# shellcheck disable=SC2086
git blame $NOT_WHITESPACE --line-porcelain "$1" -- "$file" 2> /dev/null |
LC_ALL=C sed -n "$PATTERN" | sort | uniq -c | LC_ALL=C sed 's/^\(.\)/- \1/' >> "$MERGED_LOG"
# if $2 not given, use current commit as "until"
git blame "$NOT_WHITESPACE" --line-porcelain "${2-@}" -- "$file" 2> /dev/null |
# shellcheck disable=SC2086
git blame $NOT_WHITESPACE --line-porcelain "${2-@}" -- "$file" 2> /dev/null |
LC_ALL=C sed -n "$PATTERN" | sort | uniq -c | LC_ALL=C sed 's/^\(.\)/+ \1/' >> "$MERGED_LOG"
done

Expand Down
6 changes: 4 additions & 2 deletions bin/git-repl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ while true; do
esac

if [[ $cmd == !* ]]; then
eval "${cmd:1}"
# shellcheck disable=SC2086
eval ${cmd:1}
elif [[ $cmd == git* ]]; then
eval "$cmd"
# shellcheck disable=SC2086
eval $cmd
else
eval git "$cmd"
fi
Expand Down
5 changes: 3 additions & 2 deletions bin/git-scp
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ function scp_and_stage
if [ -n "$list" ]
then
local _TMP=${0///}
# shellcheck disable=SC2086
echo "$list" > "$_TMP" &&
_sanitize "$list" &&
_sanitize $list &&
_info "Pushing to $remote ($(git config "remote.$remote.url"))" &&
rsync -rlDv --files-from="$_TMP" ./ "$(git config "remote.$remote.url")/" &&
git add --force "$list" &&
git add --force $list &&
rm "$_TMP"
fi

Expand Down

0 comments on commit b5e760e

Please sign in to comment.