1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-05-21 15:18:57 +01:00
Files
Stefan Agner f8e1acf1b0 Enable flake8-pathlib (PTH) ruff rules (#6860)
Turn on the PTH rule set in ruff and convert the remaining call sites
that triggered violations:

- `supervisor/utils/yaml.py` and `tests/homeassistant/test_module.py`
  use `Path.open()` instead of the builtin `open()`.
- `tests/backups/test_backup.py` and
  `tests/resolution/fixup/test_store_execute_reset.py` use
  `Path.iterdir()` instead of `os.listdir()`.
- `tests/mounts/test_mount.py` uses `Path.unlink()` instead of
  `os.remove()`.
- `tests/store/test_translation_load.py` uses `Path.mkdir(parents=True)`
  instead of `os.makedirs()`.
- `tests/hardware/test_disk.py` captures the unpatched `Path.is_dir`,
  `Path.is_symlink` and `Path.stat` before the `patch.object(Path, ...)`
  block so the mocks can delegate to the real implementations without
  reaching for `os.path.isdir`/`os.path.islink`/`os.stat`.
2026-05-20 22:45:59 +02:00
..