From 979fbb0e64348adbf4c0a13ba34172275cc6a1e2 Mon Sep 17 00:00:00 2001 From: ngxstat-bot Date: Sat, 16 Aug 2025 05:14:01 -0500 Subject: [PATCH] ci(lint): configure flake8 excludes/line-length; fix F541 and F401 in tests --- .flake8 | 6 ++++++ tests/test_nginx_config.py | 2 +- tests/test_run_analysis.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..0ba73e9 --- /dev/null +++ b/.flake8 @@ -0,0 +1,6 @@ +[flake8] +exclude = .git, .venv, output, static/icons +max-line-length = 160 +per-file-ignores = + tests/test_*.py: E402 + diff --git a/tests/test_nginx_config.py b/tests/test_nginx_config.py index a6494a7..b2b1317 100644 --- a/tests/test_nginx_config.py +++ b/tests/test_nginx_config.py @@ -1,6 +1,6 @@ import sys from pathlib import Path -import pytest +import pytest # noqa: F401 REPO_ROOT = Path(__file__).resolve().parents[1] sys.path.append(str(REPO_ROOT)) diff --git a/tests/test_run_analysis.py b/tests/test_run_analysis.py index fad7953..7150895 100644 --- a/tests/test_run_analysis.py +++ b/tests/test_run_analysis.py @@ -16,7 +16,7 @@ def test_script_invokes_commands(tmp_path): python_stub = tmp_path / "python" python_stub.write_text(f'#!/usr/bin/env bash\necho "$*" >> "{calls}"\n') python_stub.chmod(0o755) - (tmp_path / "python3").write_text(f"#!/usr/bin/env bash\nexit 0\n") + (tmp_path / "python3").write_text("#!/usr/bin/env bash\nexit 0\n") (tmp_path / "python3").chmod(0o755) env = os.environ.copy()