livery.extensions.clang.tidy._steps¶
livery.extensions.clang.tidy._steps ¶
clang-tidy's step: each cpp package's sources, over its compilation database.
The extension's extension.toml declares it and names the body here.
lint.clang-tidy judges one package at a time, after the package's
build is configured: the files its claims reach in the package, or the
files a run names (livery.workshop.scoped_files), against the
compilation database the package's build writes, its extensions'
answer to livery.workshop.COMPILE_COMMANDS; a package whose build
writes none skips, saying so. The checks are the
package's own .clang-tidy, which the extension writes. The step
hands clang-tidy the words after -- on its own verb
(fm lint.clang-tidy -- --checks=-*,bugprone-*). A body resolves its
runner on this module when it runs, so a test that replaces run_lint
here sees its replacement called.
Functions:
| Name | Description |
|---|---|
toolchain_arguments |
What the standalone clang-tidy needs, and why it cannot run. |
run_lint |
Run clang-tidy over files of package against database; a finding refuses. |
judge_lint |
Run clang-tidy over the package's files the run reaches, against its database. |
toolchain_arguments ¶
What the standalone clang-tidy needs, and why it cannot run.
The static build is one binary. It carries no resource directory of
its own, so the compiler's builtin headers (stddef.h and its kin)
come from the host's compiler, and on macOS the standard library
comes from the SDK xcrun names. Returns the arguments and an empty
reason, or no arguments and the reason the lint cannot run, which
the caller prints as a skip.
Source code in packages/extensions/clang-tidy/src/livery/extensions/clang/tidy/_steps.py
run_lint ¶
run_lint(package: Package, files: tuple[Path, ...], database: Path, arguments: tuple[str, ...] = ()) -> None
Run clang-tidy over files of package against database; a finding refuses.
A host that cannot give the standalone binary its headers skips, saying why. arguments go to clang-tidy before the files.
Raises:
| Type | Description |
|---|---|
Failed
|
when clang-tidy finds anything, with its own output. |
Source code in packages/extensions/clang-tidy/src/livery/extensions/clang/tidy/_steps.py
judge_lint ¶
judge_lint(ctx: PhaseContext) -> None
Run clang-tidy over the package's files the run reaches, against its database.