Skip to main content

Module format

Module format 

Source
Expand description

clang-format’s configuration from [fmt] (docs/en/specs/dev-tools.md, “[fmt]”).

Structs§

ClangFormat
clang-format, and what it is run with.
FormatError
A file clang-format could not format, or cuno could not read or write.
Formatted
What formatting found: the files whose formatting differs (rewritten unless check), and those that could not be formatted, each in the order given.
StyleRefused
clang-format refused the configuration written from [fmt]: a settings problem, not one in the code.

Constants§

FILE
The file editors read, at the project root.
MARKER
The first line of every .clang-format cuno writes: a file that does not start with it is the user’s, and is not overwritten (docs/en/specs/dev-tools.md, “Configuration”).

Functions§

check_style
Whether clang-format reads tool‘s configuration, before any file is formatted with it, so a key it does not know is reported as the settings’ problem rather than as the first file’s.
clang_format_config
.clang-format for fmt in a package of lang. One section with no Language key, so every file takes it: every file is styled in the package’s language (dev-tools.md, “Target files”). A key written in [fmt.clang-format] replaces cuno’s own, since clang-format refuses a key given twice.
format
Formats files with tool: each is run through clang-format and compared with what it holds; one that differs is rewritten unless check (docs/en/specs/commands.md, “cuno fmt”). A file is never rewritten with empty output, nor when it changed while clang-format ran, and is replaced whole, never truncated in place.