Update ruff to 0.11.12 (#146037)

* Update ruff to 0.11.12
* Replace ruff legacy alias with ruff-check
This commit is contained in:
Marc Mueller
2025-06-02 16:01:10 +02:00
committed by GitHub
parent 93b8cc38d8
commit ab7c7b8d89
7 changed files with 13 additions and 8 deletions

View File

@ -360,7 +360,7 @@ jobs:
- name: Run ruff - name: Run ruff
run: | run: |
. venv/bin/activate . venv/bin/activate
pre-commit run --hook-stage manual ruff --all-files --show-diff-on-failure pre-commit run --hook-stage manual ruff-check --all-files --show-diff-on-failure
env: env:
RUFF_OUTPUT_FORMAT: github RUFF_OUTPUT_FORMAT: github

View File

@ -1,8 +1,8 @@
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.0 rev: v0.11.12
hooks: hooks:
- id: ruff - id: ruff-check
args: args:
- --fix - --fix
- id: ruff-format - id: ruff-format

2
.vscode/tasks.json vendored
View File

@ -45,7 +45,7 @@
{ {
"label": "Ruff", "label": "Ruff",
"type": "shell", "type": "shell",
"command": "pre-commit run ruff --all-files", "command": "pre-commit run ruff-check --all-files",
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true

View File

@ -1,5 +1,5 @@
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
codespell==2.4.1 codespell==2.4.1
ruff==0.11.0 ruff==0.11.12
yamllint==1.35.1 yamllint==1.35.1

View File

@ -249,6 +249,10 @@ GENERATED_MESSAGE = (
f"# Automatically generated by {Path(__file__).name}, do not edit\n\n" f"# Automatically generated by {Path(__file__).name}, do not edit\n\n"
) )
MAP_HOOK_ID_TO_PACKAGE = {
"ruff-check": "ruff",
}
IGNORE_PRE_COMMIT_HOOK_ID = ( IGNORE_PRE_COMMIT_HOOK_ID = (
"check-executables-have-shebangs", "check-executables-have-shebangs",
"check-json", "check-json",
@ -523,7 +527,8 @@ def requirements_pre_commit_output() -> str:
rev: str = repo["rev"] rev: str = repo["rev"]
for hook in repo["hooks"]: for hook in repo["hooks"]:
if hook["id"] not in IGNORE_PRE_COMMIT_HOOK_ID: if hook["id"] not in IGNORE_PRE_COMMIT_HOOK_ID:
reqs.append(f"{hook['id']}=={rev.lstrip('v')}") pkg = MAP_HOOK_ID_TO_PACKAGE.get(hook["id"]) or hook["id"]
reqs.append(f"{pkg}=={rev.lstrip('v')}")
reqs.extend(x for x in hook.get("additional_dependencies", ())) reqs.extend(x for x in hook.get("additional_dependencies", ()))
output = [ output = [
f"# Automatically generated " f"# Automatically generated "

View File

@ -24,7 +24,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.7.1,source=/uv,target=/bin/uv \
--no-cache \ --no-cache \
-c /usr/src/homeassistant/homeassistant/package_constraints.txt \ -c /usr/src/homeassistant/homeassistant/package_constraints.txt \
-r /usr/src/homeassistant/requirements.txt \ -r /usr/src/homeassistant/requirements.txt \
stdlib-list==0.10.0 pipdeptree==2.26.1 tqdm==4.67.1 ruff==0.11.0 \ stdlib-list==0.10.0 pipdeptree==2.26.1 tqdm==4.67.1 ruff==0.11.12 \
PyTurboJPEG==1.8.0 go2rtc-client==0.1.3b0 ha-ffmpeg==3.2.2 hassil==2.2.3 home-assistant-intents==2025.5.28 mutagen==1.47.0 pymicro-vad==1.0.1 pyspeex-noise==1.0.2 PyTurboJPEG==1.8.0 go2rtc-client==0.1.3b0 ha-ffmpeg==3.2.2 hassil==2.2.3 home-assistant-intents==2025.5.28 mutagen==1.47.0 pymicro-vad==1.0.1 pyspeex-noise==1.0.2
LABEL "name"="hassfest" LABEL "name"="hassfest"

View File

@ -15,7 +15,7 @@ printf "%s\n" $files
echo "==============" echo "=============="
echo "LINT with ruff" echo "LINT with ruff"
echo "==============" echo "=============="
pre-commit run ruff --files $files pre-commit run ruff-check --files $files
echo "================" echo "================"
echo "LINT with pylint" echo "LINT with pylint"
echo "================" echo "================"