Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/shellcheck-py/shellcheck-py

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😕 Is this related to this ltex?

rev: v0.10.0.1
hooks:
- id: shellcheck
args: [-x]

- repo: local
hooks:
- id: local_hooks
Expand Down
14 changes: 8 additions & 6 deletions ltex/ltex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ set -euo pipefail
ltex_dir=$(dirname "$0")
ltex_version=""

ltex_tag=$(cd $ltex_dir; tar -cf - ./ | md5sum | cut -d' ' -f1)
ltex_tag=$(cd "$ltex_dir"; tar -cf - ./ | md5sum | cut -d' ' -f1)
ltex_version="ltex:$ltex_tag"

(
cd $ltex_dir
docker inspect "$ltex_version" > /dev/null || docker build . -t "$ltex_version" -t 'ltex:latest'
cd "$ltex_dir"
docker inspect "$ltex_version" &>/dev/null || docker build . -t "$ltex_version" -t 'ltex:latest' > /dev/null
)

files_to_clean=()
Expand All @@ -38,13 +38,15 @@ for file in "$@"; do
fi
done

echo "${files_to_process[@]}" |
output=$(echo "${files_to_process[@]}" |
xargs docker run --rm -i \
--user "$UID" \
--volume "$(pwd):/src:rw,Z" \
--workdir /src \
"$ltex_version" |
sed -E 's|(app/javascript/documentation/.*?\.md):|\1x:|g' || true
"$ltex_version" 2>&1 |
sed -E 's|(app/javascript/documentation/.*?\.md):|\1x:|g' || true)

echo "$output" | grep "SEVERE: java.io.IOException: Stream closed" >/dev/null || echo "$output"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 it could make it harder to debug if a future issue would trigger a java IOException that would be stripped from the output?


cleanup

Expand Down