CLANG-FORMAT(1)

πŸ“¦ version 11.1.0, in ubuntu jammy

πŸ’– NAME πŸ’–

okay so clang-format is the manual page for clang-format 11, and we're in the User Commands section of the manual, aka CLANG-FORMAT(1). bestie, this is the formatter page, periodt. 🫢


✨ DESCRIPTION ✨

🌟 OVERVIEW 🌟

OVERVIEW: it's giving a tool to format C/C++/Java/JavaScript/Objective-C/Protobuf/C# code. no cap, it really does all those languages.

If no arguments are specified, it formats the code from standard input and writes the result to the standard output. If <file>s are given, it reformats the files. If -i is specified together with <file>s, the files are edited in-place. Otherwise, the result is written to the standard output. πŸ’…

🫢 USAGE 🫢

USAGE:

clang-format [options] [<file> ...]

πŸ’… OPTIONS πŸ’…

πŸ’– Clang-format options πŸ’–

  • --Werror β€” If set, changes formatting warnings to errors. πŸ’€
  • --assume-filename=<string> β€” Override filename used to determine the language. When reading from stdin, clang-format assumes this filename to determine the language. 🌸
  • --cursor=<uint> β€” The position of the cursor when invoking clang-format from an editor integration. πŸŽ€
  • --dry-run β€” If set, do not actually make the formatting changes. πŸ™ˆ
  • --dump-config β€” Dump configuration options to stdout and exit. Can be used with -style option. πŸ“
  • --fallback-style=<string> β€” The name of the predefined style used as a fallback in case clang-format is invoked with -style=file, but can not find the .clang-format file to use. Use -fallback-style=none to skip formatting. πŸ¦‹
  • --ferror-limit=<uint> β€” Set the maximum number of clang-format errors to emit before stopping (0 = no limit). Used only with --dry-run or -n. πŸ”₯
  • -i β€” Inplace edit <file>s, if specified. ✨
  • --length=<uint> β€” Format a range of this length (in bytes). Multiple ranges can be formatted by specifying several -offset and -length pairs. When only a single -offset is specified without -length, clang-format will format up to the end of the file. Can only be used with one input file. πŸ“
  • --lines=<string> β€” <start line>:<end line> β€” format a range of lines (both 1-based). Multiple ranges can be formatted by specifying several -lines arguments. Can't be used with -offset and -length. Can only be used with one input file. 🧚
  • -n β€” Alias for --dry-run. πŸ‘‘
  • --offset=<uint> β€” Format a range starting at this byte offset. Multiple ranges can be formatted by specifying several -offset and -length pairs. Can only be used with one input file. 🌈
  • --output-replacements-xml β€” Output replacements as XML. πŸ’Ύ
  • --sort-includes β€” If set, overrides the include sorting behavior determined by the SortIncludes style flag. ⭐
  • --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="{key: value, ...}" to set specific parameters, e.g.:

-style="{BasedOnStyle: llvm, IndentWidth: 8}"
  • --verbose β€” If set, shows the list of processed files. πŸ—‚οΈ

🌈 Generic Options 🌈

  • --help β€” Display available options (--help-hidden for more). πŸ†˜
  • --help-list β€” Display list of available options (--help-list-hidden for more). πŸ“‹
  • --version β€” Display the version of this program. 🏷️

okay bestie, that's the whole page πŸ’… β€” brought to you by clang-format 11, January 2022, and CLANG-FORMAT(1). bye, go format something cute ✨🫢

πŸ“¦ where this page comes from