Skip to content

Commit 5c237e3

Browse files
committed
tox.ini: make lint match pre-commit rules
Signed-off-by: Albert Esteve <[email protected]>
1 parent 25b033c commit 5c237e3

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

oci-hooks/tests/test_hook_configs.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,10 @@ def test_hook_executable_exists(self, hook_configs, hook_name):
242242
# If absolute path fails, try relative to config file
243243
hook_path = config_path.parent / hook_path.name
244244

245-
# Special case: seat manager uses the shared device manager executable
245+
# Special case: seat manager uses shared device manager executable
246246
if not hook_path.exists() and hook_name == "oci-qm-seat-manager":
247-
hook_path = (
248-
config_path.parent.parent
249-
/ "qm-device-manager"
250-
/ hook_path.name
251-
)
247+
parent_dir = config_path.parent.parent
248+
hook_path = parent_dir / "qm-device-manager" / hook_path.name
252249

253250
assert hook_path.exists(), f"Hook executable not found: {hook_path}"
254251
assert hook_path.is_file(), f"Hook executable not a file: {hook_path}"
@@ -404,16 +401,13 @@ def test_hook_config_integration(self, hook_configs, hook_name):
404401
# If absolute path fails, try relative to config directory
405402
full_hook_path = config_path.parent / Path(hook_path).name
406403

407-
# Special case: seat manager uses the shared device manager executable
408-
if (
409-
not full_hook_path.exists()
410-
and hook_name == "oci-qm-seat-manager"
411-
):
412-
full_hook_path = (
413-
config_path.parent.parent
414-
/ "qm-device-manager"
415-
/ Path(hook_path).name
416-
)
404+
# Special case: seat manager uses shared device manager executable
405+
is_seat_manager = hook_name == "oci-qm-seat-manager"
406+
if not full_hook_path.exists() and is_seat_manager:
407+
parent_dir = config_path.parent.parent
408+
hook_name_path = Path(hook_path).name
409+
device_mgr_dir = parent_dir / "qm-device-manager"
410+
full_hook_path = device_mgr_dir / hook_name_path
417411

418412
# Check that executable exists
419413
assert full_hook_path.exists(), (

oci-hooks/tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ commands =
4848

4949
[testenv:lint]
5050
deps =
51-
black
51+
flake8
5252
pylint
5353
shellcheck-py
5454
allowlist_externals = shfmt
5555
commands =
56-
black --check --diff --line-length 79 tests/
56+
flake8 -j8 --ignore=W503 tests/
5757
pylint --rcfile=tests/.pylintrc tests/*.py
5858
shellcheck qm-device-manager/oci-qm-device-manager
5959
shellcheck wayland-client-devices/oci-qm-wayland-client-devices
@@ -79,4 +79,4 @@ commands =
7979

8080
[flake8]
8181
max-line-length = 79
82-
extend-ignore = E203, W503
82+
ignore = W503

0 commit comments

Comments
 (0)