Skip to content

Commit

Permalink
try clang-tidy-16 without workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianPommerening committed Jul 8, 2024
1 parent 5a76efd commit f376db7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ jobs:
- name: Install dependencies
run: |
pip3 install tox
sudo apt-get -y install clang-tidy-15
# TODO: Remove once issue with Ubuntu 24.04 and clang++-15 is resolved.
- name: Work around https://github.com/actions/runner-images/issues/8659
run: |
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-noble.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.39-* libc6-dev=2.39-* libstdc++6=12-* libgcc-s1=12-*
sudo apt-get -y install clang-tidy-16
- name: Install uncrustify
run: |
Expand Down
8 changes: 4 additions & 4 deletions misc/style/run-clang-tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def check_search_code_with_clang_tidy():
{{key: performance-unnecessary-value-param.AllowedTypes, value: "{';'.join(LIGHTWEIGHT_TYPES)}"}},\
]}}""".replace(" ", "")
cmd = [
"run-clang-tidy-15",
"run-clang-tidy-16",
"-quiet",
"-p", build_dir,
"-clang-tidy-binary=clang-tidy-15",
"-clang-tidy-binary=clang-tidy-16",
"-checks=-*," + ",".join(checks),
f"-config={config}",
]
Expand All @@ -116,7 +116,7 @@ def check_search_code_with_clang_tidy():
try:
p = subprocess.run(cmd, cwd=DIR, text=True, capture_output=True, check=False)
except FileNotFoundError:
sys.exit(f"run-clang-tidy-15 not found. Is it on the PATH?")
sys.exit(f"run-clang-tidy-16 not found. Is it on the PATH?")
output = f"{p.stdout}\n{p.stderr}"
errors = re.findall(r"^(.*:\d+:\d+: .*(?:warning|error): .*)$", output, flags=re.M)
filtered_errors = [error for error in errors if not any(ignore in error for ignore in IGNORES)]
Expand All @@ -126,7 +126,7 @@ def check_search_code_with_clang_tidy():
for error in filtered_errors:
print(error)
fix_cmd = cmd + [
"-clang-apply-replacements-binary=clang-apply-replacements-15", "-fix"]
"-clang-apply-replacements-binary=clang-apply-replacements-16", "-fix"]
print("\nYou may be able to fix some of these issues with the following command:\n" +
" ".join(pipes.quote(x) for x in fix_cmd))
sys.exit(1)
Expand Down

0 comments on commit f376db7

Please sign in to comment.