From b994141bc64980cfbabf5bcaf6f7faccf757f09c Mon Sep 17 00:00:00 2001
From: Aarni Koskela <akx@iki.fi>
Date: Mon, 27 Nov 2023 22:23:37 +0200
Subject: [PATCH] CI: simplify Ruff-related things (#104602)

---
 .github/workflows/ci.yaml            | 27 ++++++-------------------
 .github/workflows/matchers/ruff.json | 30 ----------------------------
 2 files changed, 6 insertions(+), 51 deletions(-)
 delete mode 100644 .github/workflows/matchers/ruff.json

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index ba2917042af..69e727d3aa9 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -292,17 +292,12 @@ jobs:
           key: >-
             ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
               needs.info.outputs.pre-commit_cache_key }}
-      - name: Run ruff-format (fully)
+      - name: Run ruff-format
         run: |
           . venv/bin/activate
           pre-commit run --hook-stage manual ruff-format --all-files --show-diff-on-failure
-      - name: Run ruff-format (partially)
-        if: needs.info.outputs.test_full_suite == 'false'
-        shell: bash
-        run: |
-          . venv/bin/activate
-          shopt -s globstar
-          pre-commit run --hook-stage manual ruff-format --files {homeassistant,tests}/components/${{ needs.info.outputs.integrations_glob }}/{*,**/*} --show-diff-on-failure
+        env:
+          RUFF_OUTPUT_FORMAT: github
 
   lint-ruff:
     name: Check ruff
@@ -337,22 +332,12 @@ jobs:
           key: >-
             ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
               needs.info.outputs.pre-commit_cache_key }}
-      - name: Register ruff problem matcher
-        run: |
-          echo "::add-matcher::.github/workflows/matchers/ruff.json"
-      - name: Run ruff (fully)
-        if: needs.info.outputs.test_full_suite == 'true'
+      - name: Run ruff
         run: |
           . venv/bin/activate
           pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure
-      - name: Run ruff (partially)
-        if: needs.info.outputs.test_full_suite == 'false'
-        shell: bash
-        run: |
-          . venv/bin/activate
-          shopt -s globstar
-          pre-commit run --hook-stage manual ruff --files {homeassistant,tests}/components/${{ needs.info.outputs.integrations_glob }}/{*,**/*} --show-diff-on-failure
-
+        env:
+          RUFF_OUTPUT_FORMAT: github
   lint-other:
     name: Check other linters
     runs-on: ubuntu-22.04
diff --git a/.github/workflows/matchers/ruff.json b/.github/workflows/matchers/ruff.json
deleted file mode 100644
index d189a3656a5..00000000000
--- a/.github/workflows/matchers/ruff.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "problemMatcher": [
-    {
-      "owner": "ruff-error",
-      "severity": "error",
-      "pattern": [
-        {
-          "regexp": "^(.*):(\\d+):(\\d+):\\s([EF]\\d{3}\\s.*)$",
-          "file": 1,
-          "line": 2,
-          "column": 3,
-          "message": 4
-        }
-      ]
-    },
-    {
-      "owner": "ruff-warning",
-      "severity": "warning",
-      "pattern": [
-        {
-          "regexp": "^(.*):(\\d+):(\\d+):\\s([CDNW]\\d{3}\\s.*)$",
-          "file": 1,
-          "line": 2,
-          "column": 3,
-          "message": 4
-        }
-      ]
-    }
-  ]
-}