CLANG-APPLY-REPLACEMENTS(1)
π clang-apply-replacements(1) β User Commands π
okay bestie, so this is the manual for clang-apply-replacements, version 21. it's a User Commands page, meaning it lives in section 1, and it's literally the tool that takes your replacement files and Actually Does Something with them. come sit, we're gonna go through every single flag, no skipping, no cap. β¨
πΈ DESCRIPTION πΈ
here's how you call it, exactly:
USAGE: clang-apply-replacements [options] <Search Root Directory>
so you hand it a search root directory and a pile of options, and it goes to work. that's the vibe. <Search Root Directory> is not optional in spirit β it's the place it's gonna look. π«Ά
then we got OPTIONS, and they come in three lil flavor groups: Formatting, Generic, and Replacement. let's get into it. π
β¨ Formatting Options β¨
these ones are all about making your code look pretty after it gets rewritten. iconic.
--formatβ turn on formatting for any code that changed because replacements got applied. heads up tho: you gotta use-styleto actually pick which formatting style. it doesn't just guess. π--style=<string>β set the coding style. and<string>can be a whole bunch of things, so let's go one by one:- a preset name. your options are:
LLVM,GNU,Google,Chromium,Microsoft,Mozilla,WebKit. pick your fighter. π - literally the word
fileβ this means "load the style config from a.clang-formatfile sitting in one of the parent directories of the source file." (and if you're reading from stdin, see--assume-filename, okay?) and if there's no.clang-formatfile anywhere up the tree, it falls back to--fallback-style. also important:--style=fileis the default, so if you don't say anything, this is what you're getting. no cap. π file:<format_file_path>β same energy but you're explicitly pointing at the configuration file. no hunting through parent dirs, you just tell it where it lives. π"{key: value, ...}"β set specific parameters inline, right there in the command. for example:
- a preset name. your options are:
--style="{BasedOnStyle: llvm, IndentWidth: 8}"
that's it, that's the whole syntax. slay. π
--style-config=<string>β a path to a directory that contains a.clang-formatfile, and that file describes the formatting style to use when you're formatting code with-style=file. so it's the "where do I look" flag that pairs with-style=file. π§
π Generic Options π
the standard-issue stuff. every tool has em, these are these ones:
--helpβ shows you the available options. and if you wanna go deeper, there's--help-hiddenfor more. π--help-listβ shows you the list of available options. and yeah, same deal,--help-list-hiddenexists if you want the extra ones. π--versionβ prints the version of this program. that's it. one job, does it well. β
π Replacement Options π
the main character flags, honestly. these control what happens when replacements get merged in.
--ignore-insert-conflictβ ignores an insert conflict and just keeps running so it can fix things. so instead of throwing hands over a conflict, it keeps on going. π--remove-change-desc-filesβ removes the change description files, and it does this regardless of whether the merging/replacing actually succeeded. read that again bestie β regardless. π
and that's the whole page, fr fr. every flag, every value, every default, all present and accounted for. π
this was clang-apply-replacements, version 21, dated September 2026 β go forth and format responsibly, bestie π
β¨πΈ
π¦ where this page comes from
- ubuntu stonking: clang-tools-21 1:21.1.8-10ubuntu2 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms