.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. .TH CLANG-FORMAT "1" "February 2024" "clang-format 15" "User Commands" .SH NAME clang-format \- manual page for clang-format 15 .SH DESCRIPTION OVERVIEW: A tool to format C/C++/Java/JavaScript/JSON/Objective\-C/Protobuf/C# code. .PP If no arguments are specified, it formats the code from standard input and writes the result to the standard output. If s are given, it reformats the files. If \fB\-i\fR is specified together with s, the files are edited in\-place. Otherwise, the result is written to the standard output. .PP USAGE: clang\-format [options] [ ...] .PP OPTIONS: .PP Clang\-format options: .HP \fB\-\-Werror\fR \- If set, changes formatting warnings to errors .HP \fB\-\-Wno\-error=\fR \- If set don't error out on the specified warning type. .TP =unknown \- If set, unknown format options are only warned about. .TP 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. .TP \fB\-\-assume\-filename=\fR \- Set filename used to determine the language and to find \&.clang\-format file. Only used when reading from stdin. If this is not passed, the .clang\-format file is searched relative to the current working directory when reading stdin. Unrecognized filenames are treated as C++. supported: .TP CSharp: .cs Java: .java JavaScript: .mjs .js .ts Json: .json Objective\-C: .m .mm Proto: .proto .protodevel TableGen: .td TextProto: .textpb .pb.txt .textproto .asciipb Verilog: .sv .svh .v .vh .TP \fB\-\-cursor=\fR \- The position of the cursor when invoking clang\-format from an editor integration .HP \fB\-\-dry\-run\fR \- If set, do not actually make the formatting changes .TP \fB\-\-dump\-config\fR \- Dump configuration options to stdout and exit. Can be used with \fB\-style\fR option. .TP \fB\-\-fallback\-style=\fR \- The name of the predefined style used as a fallback in case clang\-format is invoked with \fB\-style\fR=\fI\,file\/\fR, but can not find the .clang\-format file to use. Defaults to 'LLVM'. Use \fB\-fallback\-style\fR=\fI\,none\/\fR to skip formatting. .TP \fB\-\-ferror\-limit=\fR \- Set the maximum number of clang\-format errors to emit before stopping (0 = no limit). Used only with \fB\-\-dry\-run\fR or \fB\-n\fR .HP \fB\-\-files=\fR \- Provide a list of files to run clang\-format .HP \fB\-i\fR \- Inplace edit s, if specified. .TP \fB\-\-length=\fR \- Format a range of this length (in bytes). Multiple ranges can be formatted by specifying several \fB\-offset\fR and \fB\-length\fR pairs. When only a single \fB\-offset\fR is specified without \fB\-length\fR, clang\-format will format up to the end of the file. Can only be used with one input file. .TP \fB\-\-lines=\fR \- : \- format a range of lines (both 1\-based). Multiple ranges can be formatted by specifying several \fB\-lines\fR arguments. Can't be used with \fB\-offset\fR and \fB\-length\fR. Can only be used with one input file. .HP \fB\-n\fR \- Alias for \fB\-\-dry\-run\fR .TP \fB\-\-offset=\fR \- Format a range starting at this byte offset. Multiple ranges can be formatted by specifying several \fB\-offset\fR and \fB\-length\fR pairs. Can only be used with one input file. .HP \fB\-\-output\-replacements\-xml\fR \- Output replacements as XML. .TP \fB\-\-qualifier\-alignment=\fR \- If set, overrides the qualifier alignment style determined by the QualifierAlignment style flag .TP \fB\-\-sort\-includes\fR \- If set, overrides the include sorting behavior determined by the SortIncludes style flag .TP \fB\-\-style=\fR \- Set coding style. can be: 1. A preset: LLVM, GNU, Google, Chromium, Microsoft, .TP Mozilla, WebKit. 2. 'file' to load style configuration from a .TP \&.clang\-format file in one of the parent directories of the source file (for stdin, see \fB\-\-assume\-filename\fR). If no .clang\-format file is found, falls back to \fB\-\-fallback\-style\fR. \fB\-\-style\fR=\fI\,file\/\fR is the default. .TP 3. 'file:' to explicitly specify the configuration file. .TP 4. "{key: value, ...}" to set specific parameters, e.g.: \fB\-\-style=\fR"{BasedOnStyle: llvm, IndentWidth: 8}" .HP \fB\-\-verbose\fR \- If set, shows the list of processed files .PP Generic Options: .HP \fB\-\-help\fR \- Display available options (\fB\-\-help\-hidden\fR for more) .HP \fB\-\-help\-list\fR \- Display list of available options (\fB\-\-help\-list\-hidden\fR for more) .HP \fB\-\-version\fR \- Display the version of this program