unwanted unicode

This commit is contained in:
Paolo Asperti 2024-08-10 13:41:48 +02:00
parent ad9c038351
commit 8312aaf2af
Signed by: paspo
GPG Key ID: 06D46905D19D5182
3 changed files with 33 additions and 0 deletions

View File

@ -19,3 +19,7 @@ jobs:
with: with:
entrypoint: /bin/sh entrypoint: /bin/sh
args: -c 'apk -U add git bash ; bash .gitea/workflows/markdownlint_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}' args: -c 'apk -U add git bash ; bash .gitea/workflows/markdownlint_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}'
- name: check for unwanted unicode runes
run: |
bash .gitea/workflows/unwanted_unicode_pr.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}'

View File

@ -0,0 +1,6 @@

View File

@ -0,0 +1,23 @@
#!/bin/bash
echo
echo "Initial commit: $1"
echo "Final commit: $2"
echo
# recupera ogni file modificato in questa PR (tra le 2 commit)
# considera solo i file che terminano con .md
# ogni file viene controllato con grep, con i pattern definiti
# nel file di configurazione
EXIT=0
while read -r LINE; do
if [ -r "$LINE" ] ; then
echo
echo "testing file: $LINE"
grep --color -f .gitea/workflows/unwanted_unicode_patterns.grep "$LINE" && EXIT=1
fi
done < <(git diff --name-only "$1" "$2" content/ | grep \.md$)
exit ${EXIT}