CLANG-FORMAT(1)
π CLANG-FORMAT π
okay bestie, pull up a chair, because this is the manual page for clang-format, and yes it's a User Commands girly in section 1 of the manual. she's giving β¨toolβ¨ energy and honestly? obsessed.
πΈ NAME πΈ
clang-format β literally the manual page for clang-format 14, no cap π
π¦ DESCRIPTION π¦
OVERVIEW: a tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code. she does it ALL, she contains multitudes, main character energy fr fr π
so here's the vibe check on how she behaves:
- if you give her no arguments at all, she formats the code coming in from standard input and writes the result straight to standard output π
- if you hand her
<file>s, she reformats the files π«Ά - if
-ishows up together with<file>s, the files get edited in-place (yes bestie, she's touching your actual files, be normal about it) π - otherwise, the result is written to the standard output π
USAGE:
clang-format [options] [<file> ...]
β¨ OPTIONS β¨
π Clang-format options:
--Werrorβ if set, changes formatting warnings into errors. she said no more playing games, warnings are crimes now π--Wno-error=<value>β if set, don't error out on the specified warning type.=unknownβ if set, unknown format options are only warned about.
this can be used to enable formatting even if the configuration contains unknown (newer) options. > use with caution, as this might lead to dramatically differing format depending on an option being supported or not. like, dramatic dramatic. she's not kidding π¨
--assume-filename=<string>β override the filename used to determine the language. when reading from stdin,clang-formatassumes this filename to determine the language. it's giving "pretend i'm this file bestie" π§--cursor=<uint>β the position of the cursor when invokingclang-formatfrom an editor integration. editor besties, this one's for you π--dry-runβ if set, do not actually make the formatting changes. window shopping only, no purchasing π--dump-configβ dump configuration options to stdout and exit. can be used with the-styleoption. it's giving "show me everything you got" π--fallback-style=<string>β the name of the predefined style used as a fallback in caseclang-formatis invoked with-style=file, but can not find the.clang-formatfile to use. use-fallback-style=noneto skip formatting. the backup plan, the understudy, the safety net π¦--ferror-limit=<uint>β set the maximum number ofclang-formaterrors to emit before stopping (0= no limit). used only with--dry-runor-n. lowkey a "okay that's ENOUGH" setting π--files=<string>β provide a list of files to runclang-formaton. a whole squad, a whole roster π«Ά-iβ inplace edit<file>s, if specified. she's going in and she's changing things, no going back π--length=<uint>β format a range of this length (in bytes). multiple ranges can be formatted by specifying several-offsetand-lengthpairs. when only a single-offsetis specified without-length,clang-formatwill format up to the end of the file. can only be used with one input file. one file at a time, she's not doing group projects on this one π--lines=<string>β<start line>:<end line>- format a range of lines (both 1-based). multiple ranges can be formatted by specifying several-linesarguments. can't be used with-offsetand-length. can only be used with one input file. it's the line-range girlie of the family β¨-nβ alias for--dry-run. same vibe, shorter name, iconic π--offset=<uint>β format a range starting at this byte offset. multiple ranges can be formatted by specifying several-offsetand-lengthpairs. can only be used with one input file. π--output-replacements-xmlβ output replacements as XML. yes, XML. in this economy. π₯--qualifier-alignment=<string>β if set, overrides the qualifier alignment style determined by theQualifierAlignmentstyle flag. she said "i'm overriding that" periodt π--sort-includesβ if set, overrides the include sorting behavior determined by theSortIncludesstyle flag. your includes, sorted, your way πΈ--style=<string>β coding style, currently supports:LLVM,GNU,Google,Chromium,Microsoft,Mozilla,WebKit.
use -style=file to load style configuration from .clang-format file located in one of the parent directories of the source file (or current directory for stdin). use -style=file:<format_file_path> to explicitly specify the configuration file. use -style="{key: value, ...}" to set specific parameters, e.g.:
-style="{BasedOnStyle: llvm, IndentWidth: 8}"
(yes, that's verbatim, that's the exact syntax, don't @ me π)
--verboseβ if set, shows the list of processed files. she's narrating her own journey, and honestly? deserved π
π Generic Options:
--helpβ display available options (--help-hiddenfor more). the classic, the icon, the blueprint π--help-listβ display list of available options (--help-list-hiddenfor more). same energy, list format π--versionβ display the version of this program. she'll tell you who she is π¦
bestie reminder:-imeans in-place edits on real files.--dry-run/-nis your safe little preview. choose wisely, we love you π
and that's the whole page! this manual page came to you from clang-format 14, dated May 2025 β she's been around, she's been formatting, she's thriving. go forth and format, bestie, you've got this πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- ubuntu questing: clang-format-14 1:14.0.6-20ubuntu3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms