Repository: hacs/integration (branch: more-proxy-tests)
Commit date: 2023-12-16T21:16:03Z

Workflow file: .github/workflows/lint.yaml (Lint)
name: Lint

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main

concurrency:
  group: lint-${{ github.ref }}
  cancel-in-progress: true

jobs:
  matrix:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    name: Run ${{ matrix.check }}
    strategy:
      matrix:
        check:
          - pyupgrade
          - black
          - codespell
          - check-executables-have-shebangs
          - check-json
          - requirements-txt-fixer
          - check-ast
          - mixed-line-ending
    steps:
      - name: 📥 Checkout the repository
        uses: actions/checkout@v4.1.1

      - name: 🛠️ Set up Python
        uses: actions/setup-python@v4.7.1
        id: python
        with:
          python-version: "3.11"

      - name: 📦 Install pre-commit
        run: |
          scripts/install/pip_packages pre-commit
          pre-commit install-hooks --config .github/pre-commit-config.yaml

      - name: 🏃 Run the check (${{ matrix.check }})
        run: pre-commit run --hook-stage manual ${{ matrix.check }} --all-files --config .github/pre-commit-config.yaml

  lint-json:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    name: With JQ
    steps:
    - name: 📥 Checkout the repository
      uses: actions/checkout@v4.1.1

    - name: 🏃 Run validation
      run: jq -r -e -c . tests/fixtures/*.json
env:
  PIP_INDEX_URL: http://localhost:8629/2023-12-16
  UV_INDEX_URL: http://localhost:8629/2023-12-16


Failed build logs:
step_name: Run pyupgrade/5_🏃 Run the check (pyupgrade).txt
log: ##[group]Run pre-commit run --hook-stage manual pyupgrade --all-files --config .github/pre-commit-config.yaml
[36;1mpre-commit run --hook-stage manual pyupgrade --all-files --config .github/pre-commit-config.yaml[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.11.7/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib
##[endgroup]
pyupgrade................................................................Failed
- hook id: pyupgrade
- exit code: 1
- files were modified by this hook

Rewriting tests/common.py

##[error]Process completed with exit code 1.

step_name: Run black/5_🏃 Run the check (black).txt
log: ##[group]Run pre-commit run --hook-stage manual black --all-files --config .github/pre-commit-config.yaml
[36;1mpre-commit run --hook-stage manual black --all-files --config .github/pre-commit-config.yaml[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.11.7/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.7/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.7/x64/lib
##[endgroup]
black....................................................................Failed
- hook id: black
- files were modified by this hook
##[error]Process completed with exit code 1.


Changed files:
tests/common.py

Fix diff:
diff --git a/tests/common.py b/tests/common.py
index 190a2fba..ea30646a 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -13,7 +13,13 @@ from unittest.mock import AsyncMock, Mock, patch
 from aiohttp import ClientSession, ClientWebSocketResponse
 from aiohttp.typedefs import StrOrURL
 from awesomeversion import AwesomeVersion
-from homeassistant import auth, bootstrap, config_entries, core as ha, config as ha_config
+from homeassistant import (
+    auth,
+    bootstrap,
+    config as ha_config,
+    config_entries,
+    core as ha,
+)
 from homeassistant.auth import auth_store, models as auth_models
 from homeassistant.const import (
     EVENT_HOMEASSISTANT_CLOSE,
@@ -49,13 +55,13 @@ TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
 INSTANCES = []
 REQUEST_CONTEXT: ContextVar[pytest.FixtureRequest] = ContextVar("request_context", default=None)
 
-IGNORED_BASE_FILES = set([
-        "/config/automations.yaml",
-        "/config/configuration.yaml",
-        "/config/scenes.yaml",
-        "/config/scripts.yaml",
-        "/config/secrets.yaml",
-    ])
+IGNORED_BASE_FILES = {
+    "/config/automations.yaml",
+    "/config/configuration.yaml",
+    "/config/scenes.yaml",
+    "/config/scripts.yaml",
+    "/config/secrets.yaml",
+}
 
 
 def safe_json_dumps(data: dict | list) -> str: