fix: Fix clang-tidy pre-commit hook to locate compile_commands.json from repo root (#7325)

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
Pratik Mankawde
2026-05-26 14:50:18 +01:00
committed by GitHub
parent a911f9089e
commit e9d885bd9b
2 changed files with 7 additions and 1 deletions

0
.github/scripts/levelization/generate.py vendored Normal file → Executable file
View File

View File

@@ -168,7 +168,13 @@ def main():
if not os.environ.get("TIDY"):
return 0
repo_root = Path(__file__).parent.parent
repo_root = Path(
subprocess.check_output(
["git", "rev-parse", "--show-toplevel"],
cwd=Path(__file__).parent,
text=True,
).strip()
)
files = staged_files(repo_root)
if not files:
return 0