Skip to content

Commit

Permalink
use clang-tidy-14
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianPommerening committed Jul 5, 2024
1 parent e418573 commit 498660c
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-12
# TODO: Remove once issue with Ubuntu 22.04 and clang++-14 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-jammy.list
sudo apt-get update
sudo apt-get install -y --allow-downgrades libc6=2.35-* libc6-dev=2.35-* libstdc++6=12.3.0-* libgcc-s1=12.3.0-*
sudo apt-get -y install clang-tidy-14
- 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-12",
"run-clang-tidy-14",
"-quiet",
"-p", build_dir,
"-clang-tidy-binary=clang-tidy-12",
"-clang-tidy-binary=clang-tidy-14",
"-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-12 not found. Is it on the PATH?")
sys.exit(f"run-clang-tidy-14 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-12", "-fix"]
"-clang-apply-replacements-binary=clang-apply-replacements-14", "-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 498660c

Please sign in to comment.