gecko-dev/tools/lint/clang-format.yml
Mitchell Hentges 8c04017a04 Bug 1750632: ./mach lint should bootstrap clang-format r=ahal
Tie into `code_analysis`'s `get_clang_tools()` functionality to
intelligently bootstrap clang if it either doesn't exist or is
out-of-date.

This required exposing `command_context` to the linting logic, as it's
needed to call `artifact_toolchain(...)`.

Note that this means that the standalone `runcli.py` file won't be able
to support bootstrapping `clang-format`, or other linters that lean on
`command_context` in the future.

Finally, `substs.get("HOST_BIN_SUFFIX")` was replaced with a
windows-specific `binary += ".exe"`, because not all contexts where
the tests are run will have access to populated `substs` data.
Note that this worked before without the extension because it was
only used for starting a process, in which context Windows automatically
tries all `PATHEXT` options. Since we're now doing an `isfile()` check
(to enable more intelligent failure cases when `clang-format` doesn't
exist), we need the path to be fully correct.

Differential Revision: https://phabricator.services.mozilla.com/D137335
2022-03-04 19:39:32 +00:00

13 lines
298 B
YAML

---
clang-format:
description: Reformat C/C++
include:
- '.'
extensions: ['cpp', 'c', 'cc', 'h', 'm', 'mm']
support-files:
- 'tools/lint/clang-format/**'
type: external
payload: clang-format:lint
code_review_warnings: false
setup: clang-format:setup