Skip to content

release/20.x: [clang-tidy] Do not pass any file when listing checks in run_clang_ti… (#137286) #137775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release/20.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def find_compilation_database(path: str) -> str:


def get_tidy_invocation(
f: str,
f: Optional[str],
clang_tidy_binary: str,
checks: str,
tmpdir: Optional[str],
Expand Down Expand Up @@ -147,7 +147,8 @@ def get_tidy_invocation(
start.append(f"--warnings-as-errors={warnings_as_errors}")
if allow_no_checks:
start.append("--allow-no-checks")
start.append(f)
if f:
start.append(f)
return start


Expand Down Expand Up @@ -490,7 +491,7 @@ async def main() -> None:

try:
invocation = get_tidy_invocation(
"",
None,
clang_tidy_binary,
args.checks,
None,
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ Improvements to clang-tidy
- Fixed bug in :program:`clang-tidy` by which `HeaderFilterRegex` did not take
effect when passed via the `.clang-tidy` file.

- Fixed bug in :program:`run_clang_tidy.py` where the program would not
correctly display the checks enabled by the top-level `.clang-tidy` file.

New checks
^^^^^^^^^^

Expand Down
Loading