ci: fix up .clang-tidy and related files (#3236)

* chore: remove clang-tidy deprecated option

* fix: lint and update workflow related items

* clang-format and clang-tidy fixes for 2aa6797d

* ci: add issues write to approved-label

* chore: remove file formatter

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
realstealthninja
2026-09-30 15:06:11 +05:30
committed by GitHub
parent b3ba9f48b5
commit b64d5ecd02
4 changed files with 24 additions and 10 deletions

View File

@@ -5,15 +5,28 @@ import sys
print("Python {}.{}.{}".format(*sys.version_info)) # Python 3.8
with open("git_diff.txt") as in_file:
modified_files = sorted(in_file.read().splitlines())
print("{} files were modified.".format(len(modified_files)))
print(f"{len(modified_files)} files were modified.")
cpp_exts = tuple(".c .c++ .cc .cpp .cu .cuh .cxx .h .h++ .hh .hpp .hxx".split())
cpp_exts = (
".c",
".c++",
".cc",
".cpp",
".cu",
".cuh",
".cxx",
".h",
".h++",
".hh",
".hpp",
".hxx",
)
cpp_files = [file for file in modified_files if file.lower().endswith(cpp_exts)]
print(f"{len(cpp_files)} C++ files were modified.")
if not cpp_files:
sys.exit(0)
subprocess.run(
_ = subprocess.run(
[
"clang-tidy",
"--fix",
@@ -26,7 +39,7 @@ with open("git_diff.txt") as in_file:
text=True,
stderr=subprocess.STDOUT,
)
subprocess.run(
_ = subprocess.run(
["clang-format", "-i", "-style=file", *cpp_files],
check=True,
text=True,