Expand description
clang-format’s configuration from [fmt]
(docs/en/specs/dev-tools.md, “[fmt]”).
Structs§
- Clang
Format - clang-format, and what it is run with.
- Format
Error - 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. - Style
Refused - 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-formatcuno 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-formatforfmtin a package oflang. One section with noLanguagekey, 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
fileswithtool: each is run through clang-format and compared with what it holds; one that differs is rewritten unlesscheck(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.