mirror of
https://github.com/flarum/core.git
synced 2025-08-18 06:11:23 +02:00
add yamllinter check (#124)
* add yamllinter check * ignore validation.yml * enhancement * cleanup
This commit is contained in:
committed by
Toby Zerner
parent
2835b0be61
commit
bca3810496
7
extensions/lang-english/.travis.yml
Normal file
7
extensions/lang-english/.travis.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
language: bash
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- go get github.com/sijad/yaml-translation-utils/yamllinter
|
||||||
|
|
||||||
|
script:
|
||||||
|
- bash scripts/linter.sh
|
32
extensions/lang-english/scripts/linter.sh
Normal file
32
extensions/lang-english/scripts/linter.sh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
if ! [ -x "$(command -v yamllinter)" ]; then
|
||||||
|
echo 'Error: yamllinter is not installed.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
cd "./locale"
|
||||||
|
|
||||||
|
RC=0
|
||||||
|
|
||||||
|
for r in *.yml
|
||||||
|
do
|
||||||
|
[ "$r" != "validation.yml" ] || continue
|
||||||
|
|
||||||
|
echo "Checking $r:"
|
||||||
|
|
||||||
|
yamllinter --file "$r" --level 2
|
||||||
|
|
||||||
|
if [ $? -eq 1 ]; then
|
||||||
|
RC=1
|
||||||
|
printf "${RED}⨉ faild${NC}\n"
|
||||||
|
else
|
||||||
|
printf "${GREEN}✓ passed${NC}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $RC
|
Reference in New Issue
Block a user