ci: ensure that lang files stay sorted
This commit is contained in:
parent
bd38df5d61
commit
a84130d67d
|
@ -14,6 +14,8 @@ jobs:
|
|||
- run: npm install
|
||||
- name: Check git status
|
||||
run: git status
|
||||
- name: Normalize lang files to ensure sorted
|
||||
run: npm run lang-sort
|
||||
- name: Check git diff
|
||||
run: git diff
|
||||
- name: Check if the git repository is clean
|
||||
|
|
|
@ -174,6 +174,7 @@
|
|||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"lint": "eslint --max-warnings 0 .",
|
||||
"lang-sort": "./resources/lang-sort.sh",
|
||||
"lint-fix": "eslint --max-warnings 0 --fix .",
|
||||
"postinstall": "patch-package && jetify",
|
||||
"validate": "npm ls",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
for file in ./lang/*.json; do
|
||||
echo "Sorting and standardizing ${file}"
|
||||
t=$(mktemp)
|
||||
jq --indent 4 -S "." "${file}" > "${t}"
|
||||
mv "${t}" "${file}"
|
||||
done
|
Loading…
Reference in New Issue