Pārlūkot izejas kodu

ci: ensure that lang files stay sorted

master
Christoph Settgast 3 gadus atpakaļ
vecāks
revīzija
a84130d67d
3 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 2
    0
      .github/workflows/ci.yml
  2. 1
    0
      package.json
  3. 8
    0
      resources/lang-sort.sh

+ 2
- 0
.github/workflows/ci.yml Parādīt failu

@@ -14,6 +14,8 @@ jobs:
14 14
     - run: npm install
15 15
     - name: Check git status
16 16
       run: git status
17
+    - name: Normalize lang files to ensure sorted
18
+      run: npm run lang-sort
17 19
     - name: Check git diff
18 20
       run: git diff
19 21
     - name: Check if the git repository is clean

+ 1
- 0
package.json Parādīt failu

@@ -174,6 +174,7 @@
174 174
   "license": "Apache-2.0",
175 175
   "scripts": {
176 176
     "lint": "eslint  --max-warnings 0 .",
177
+    "lang-sort": "./resources/lang-sort.sh",
177 178
     "lint-fix": "eslint  --max-warnings 0 --fix .",
178 179
     "postinstall": "patch-package && jetify",
179 180
     "validate": "npm ls",

+ 8
- 0
resources/lang-sort.sh Parādīt failu

@@ -0,0 +1,8 @@
1
+#!/bin/bash -e
2
+
3
+for file in ./lang/*.json; do
4
+  echo "Sorting and standardizing ${file}"
5
+  t=$(mktemp)
6
+  jq --indent 4 -S "." "${file}" > "${t}"
7
+  mv "${t}" "${file}"
8
+done

Notiek ielāde…
Atcelt
Saglabāt