Forráskód Böngészése

CI: annotate PRs with lint results

Jason Rumney 2 éve
szülő
commit
0424c38c71
3 módosított fájl, 41 hozzáadás és 2 törlés
  1. 8 2
      .github/workflows/linting.yml
  2. 15 0
      ruff.json
  3. 18 0
      yamllint.json

+ 8 - 2
.github/workflows/linting.yml

@@ -18,10 +18,16 @@ jobs:
           python -m pip install --upgrade pip
           pip install -r requirements-dev.txt
       - name: Python lint
-        run: ruff check custom_components/tuya_local
+        run: |
+          echo "::add-matcher::ruff.json"
+          ruff check custom_components/tuya_local
+          echo "::remove-matcher owner=ruff::"
       - name: Python include order
         run: ruff check --select I --diff .
       - name: Python coding style
         run: ruff format --check --diff .
       - name: YAML lint
-        run: yamllint -f parsable custom_components/tuya_local/devices
+        run: |
+          echo "::add-matcher::yamllint.json"
+          yamllint -f parsable custom_components/tuya_local/devices
+          echo "::remove-matcher owner=yamllint::"

+ 15 - 0
ruff.json

@@ -0,0 +1,15 @@
+{
+    "problemMatcher": [
+        {
+            "owner": "ruff",
+            "pattern": [
+                "regexp": "^(.*):(\\d+):(\\d*):\\s([A-Z]\\d+)\\s(.*)$",
+                "file": 1,
+                "line": 2,
+                "column": 3,
+                "code": 4,
+                "message": 5
+            ]
+        }
+    ]
+}

+ 18 - 0
yamllint.json

@@ -0,0 +1,18 @@
+{
+    "problemMatcher": [
+        {
+            "owner": "yamllint",
+            "pattern": [
+                {
+                    "regexp": "^(.*):\\s(.*):(\\d+):(\\d*):\\s(.*)\\s(\\(.*\\))$",
+                    "severity": 1,
+                    "file": 2,
+                    "line": 3,
+                    "column": 4,
+                    "message": 5,
+                    "code": 6
+                }
+            ]
+        }
+    ]
+}