Skip to content

Commit

Permalink
Further shell format fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
cloderic committed Jan 17, 2024
1 parent d4e6220 commit 83c3043
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 42 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ max_line_length = 120
[{*.py,*.yml}]
indent_size = 4

[*.sh]
switch_case_indent = true

# Ignore the entire ".venv" directory.
[.venv/**]
ignore = true
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ shellcheck:
- shellcheck $(find . -name '*.sh' | xargs)

shfmt:
image: mvdan/shfmt:v3.1.0-alpine
image: mvdan/shfmt:v3.7.0-alpine
stage: lint
before_script:
- shfmt -version
script:
- shfmt -i 2 -ci -d .
- shfmt -d .

.base:
image: python:3.10
Expand Down
40 changes: 20 additions & 20 deletions scripts/create_release_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,29 @@ dry_run=0

while [[ "$1" != "" ]]; do
case $1 in
--dry-run)
dry_run=1
;;
--help | -h)
usage
exit 0
;;
*)
if [[ -z "${version}" ]]; then
input_version=$1
validated_version=$(validate_version "${input_version}")
if [[ -z "${validated_version}" ]]; then
printf "%s: provided version is invalid.\n\n" "${input_version}"
--dry-run)
dry_run=1
;;
--help | -h)
usage
exit 0
;;
*)
if [[ -z "${version}" ]]; then
input_version=$1
validated_version=$(validate_version "${input_version}")
if [[ -z "${validated_version}" ]]; then
printf "%s: provided version is invalid.\n\n" "${input_version}"
usage
exit 1
fi
version="${validated_version}"
else
printf "%s: unrecognized argument.\n\n" "$1"
usage
exit 1
fi
version="${validated_version}"
else
printf "%s: unrecognized argument.\n\n" "$1"
usage
exit 1
fi
;;
;;
esac
shift
done
Expand Down
40 changes: 20 additions & 20 deletions scripts/tag_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ dry_run=0

while [[ "$1" != "" ]]; do
case $1 in
--dry-run)
dry_run=1
;;
--help | -h)
usage
exit 0
;;
*)
if [[ -z "${version}" ]]; then
input_version=$1
validated_version=$(validate_version "${input_version}")
if [[ -z "${validated_version}" ]]; then
printf "%s: provided version is invalid.\n\n" "${input_version}"
--dry-run)
dry_run=1
;;
--help | -h)
usage
exit 0
;;
*)
if [[ -z "${version}" ]]; then
input_version=$1
validated_version=$(validate_version "${input_version}")
if [[ -z "${validated_version}" ]]; then
printf "%s: provided version is invalid.\n\n" "${input_version}"
usage
exit 1
fi
version="${validated_version}"
else
printf "%s: unrecognized argument.\n\n" "$1"
usage
exit 1
fi
version="${validated_version}"
else
printf "%s: unrecognized argument.\n\n" "$1"
usage
exit 1
fi
;;
;;
esac
shift
done
Expand Down

0 comments on commit 83c3043

Please sign in to comment.