From 85a1a4fab8dea815f999e97a098e077b03a25c4b Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 2 Jul 2026 18:38:43 +0000 Subject: [PATCH] fix: repair strict ruff config chain and make check_licenses.py CWD-independent ruff-strict.toml extended the deleted ruff.toml, which broke the strict gate in CI; ruff supports extending a pyproject.toml directly, and the per-rule strict finding counts are identical before and after (60481 findings, same per-rule distribution), with scripts/ruff_strict_gate.py passing end to end Also anchor the pyproject.toml, uv.lock and liccheck.ini reads in check_licenses.py to the script location, matching the cache path fix, so the script no longer depends on being run from the repo root (Greptile P2) --- ruff-strict.toml | 2 +- tests/code_coverage_tests/check_licenses.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ruff-strict.toml b/ruff-strict.toml index d58885fe848..1c36d110e53 100644 --- a/ruff-strict.toml +++ b/ruff-strict.toml @@ -1,4 +1,4 @@ -extend = "ruff.toml" +extend = "pyproject.toml" [lint] preview = true diff --git a/tests/code_coverage_tests/check_licenses.py b/tests/code_coverage_tests/check_licenses.py index b3b8b926bdf..fdbd83618c9 100644 --- a/tests/code_coverage_tests/check_licenses.py +++ b/tests/code_coverage_tests/check_licenses.py @@ -11,6 +11,9 @@ from typing import Dict, List, Optional, Set, Tuple from packaging.requirements import Requirement import requests +_SCRIPT_DIR = Path(__file__).resolve().parent +_REPO_ROOT = _SCRIPT_DIR.parent.parent + DEFAULT_TRANSITIVE_PIN_PACKAGES = ( "aiofiles", "anyio", @@ -50,7 +53,7 @@ class PackageLicense: class LicenseChecker: def __init__( - self, config_file: Path = Path("./tests/code_coverage_tests/liccheck.ini") + self, config_file: Path = _SCRIPT_DIR / "liccheck.ini" ): if not config_file.exists(): print(f"Error: Config file {config_file} not found") @@ -71,7 +74,7 @@ class LicenseChecker: self.authorized_packages = self._parse_authorized_packages() # Initialize cache - self.cache_file = Path(__file__).parent / "license_cache.json" + self.cache_file = _SCRIPT_DIR / "license_cache.json" self.license_cache: Dict[str, str] = {} if self.cache_file.exists(): with open(self.cache_file) as f: @@ -314,9 +317,9 @@ class LicenseChecker: with open(requirements_file) as f: requirement_lines = f.readlines() else: - with open("pyproject.toml", "rb") as f: + with open(_REPO_ROOT / "pyproject.toml", "rb") as f: pyproject = tomllib.load(f) - with open("uv.lock", "rb") as f: + with open(_REPO_ROOT / "uv.lock", "rb") as f: lock_data = tomllib.load(f) requirement_lines = list(pyproject["project"].get("dependencies", []))