diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bff47d03a3..a326ad5af7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/package.json b/package.json index e64745fae5..edc10caff3 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/resources/lang-sort.sh b/resources/lang-sort.sh new file mode 100755 index 0000000000..249f15ee74 --- /dev/null +++ b/resources/lang-sort.sh @@ -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