Repository: hacs/integration (branch: proxy-test)
Commit date: 2023-11-17T17:36:01Z

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-11-17
  UV_INDEX_URL: http://localhost:8629/2023-11-17


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.6/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib
##[endgroup]
pyupgrade................................................................Failed
- hook id: pyupgrade
- exit code: 1
- files were modified by this hook

Rewriting tests/repositories/test_get_hacs_json.py
Rewriting tests/repositories/test_get_documentation.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.6/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.6/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.11.6/x64/lib
##[endgroup]
black....................................................................Failed
- hook id: black
- files were modified by this hook
##[error]Process completed with exit code 1.


Changed files:
tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/1.0.0/README.md
tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/2.0.0/README.md
tests/repositories/test_get_documentation.py
tests/repositories/test_get_hacs_json.py

Fix diff:
diff --git a/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/1.0.0/README.md b/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/1.0.0/README.md
index 547ce4ac..530ac586 100644
--- a/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/1.0.0/README.md
+++ b/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/1.0.0/README.md
@@ -1 +1 @@
-## Example readme file
\ No newline at end of file
+## Example readme file (1.0.0)
\ No newline at end of file
diff --git a/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/2.0.0/README.md b/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/2.0.0/README.md
index 547ce4ac..67d48bfd 100644
--- a/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/2.0.0/README.md
+++ b/tests/fixtures/proxy/raw.githubusercontent.com/octocat/integration/2.0.0/README.md
@@ -1 +1 @@
-## Example readme file
\ No newline at end of file
+## Example readme file (2.0.0)
\ No newline at end of file
diff --git a/tests/repositories/test_get_documentation.py b/tests/repositories/test_get_documentation.py
index e289d295..0b3bcbb6 100644
--- a/tests/repositories/test_get_documentation.py
+++ b/tests/repositories/test_get_documentation.py
@@ -1,19 +1,27 @@
-
 from typing import Any
+
 import pytest
+
 from custom_components.hacs.base import HacsBase
 from custom_components.hacs.repositories.base import HacsRepository
 
 from tests.common import client_session_proxy
 
 
-
-@pytest.mark.parametrize("data,result", [
-    ({"installed": True, "installed_version": "1.0.0"}, "Example readme file"),
-    ({"installed": False, "last_version": "2.0.0"}, "Example readme file")
-])
+@pytest.mark.parametrize(
+    "data,result",
+    [
+        ({"installed": True, "installed_version": "1.0.0"}, "Example readme file (1.0.0)"),
+        (
+            {"installed": True, "installed_version": "1.0.0", "last_version": "2.0.0"},
+            "Example readme file (1.0.0)",
+        ),
+        ({"installed": False, "last_version": "2.0.0"}, "Example readme file (2.0.0)"),
+        ({"installed": False, "last_version": "99.99.99"}, None),
+    ],
+)
 @pytest.mark.asyncio
-async def test_validate_repository(hacs: HacsBase, data: dict[str, Any], result: str):
+async def test_validate_repository(hacs: HacsBase, data: dict[str, Any], result: str | None):
     repository = HacsRepository(hacs=hacs)
     repository.data.full_name = "octocat/integration"
     for key, value in data.items():
@@ -22,4 +30,7 @@ async def test_validate_repository(hacs: HacsBase, data: dict[str, Any], result:
     hacs.session = await client_session_proxy(hacs.hass)
     docs = await repository.get_documentation(filename="README.md")
 
-    assert result in docs
+    if result:
+        assert result in docs
+    else:
+        assert result is None
diff --git a/tests/repositories/test_get_hacs_json.py b/tests/repositories/test_get_hacs_json.py
index 495f346d..a1a5c2eb 100644
--- a/tests/repositories/test_get_hacs_json.py
+++ b/tests/repositories/test_get_hacs_json.py
@@ -1,16 +1,12 @@
-
 import pytest
+
 from custom_components.hacs.base import HacsBase
 from custom_components.hacs.repositories.base import HacsRepository
 
 from tests.common import client_session_proxy
 
 
-
-@pytest.mark.parametrize("version,name", [
-    ("1.0.0", "Proxy integration"),
-    ("99.99.99", None)
-])
+@pytest.mark.parametrize("version,name", [("1.0.0", "Proxy integration"), ("99.99.99", None)])
 @pytest.mark.asyncio
 async def test_validate_repository(hacs: HacsBase, version: str, name: str | None):
     repository = HacsRepository(hacs=hacs)