CLANG-APPLY-REPLACEMENTS(1)

πŸ“¦
version 21.1.8 Β· 3 versions
, in ubuntu stonking

πŸ’… 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 -style to 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:
    1. a preset name. your options are: LLVM, GNU, Google, Chromium, Microsoft, Mozilla, WebKit. pick your fighter. πŸ‘‘
    2. literally the word file β€” this means "load the style config from a .clang-format file 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-format file anywhere up the tree, it falls back to --fallback-style. also important: --style=file is the default, so if you don't say anything, this is what you're getting. no cap. 🌈
    3. 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. πŸ“
    4. "{key: value, ...}" β€” set specific parameters inline, right there in the command. for example:
--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-format file, 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-hidden for more. πŸ™ˆ
  • --help-list β€” shows you the list of available options. and yeah, same deal, --help-list-hidden exists 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