@@ -30,72 +30,69 @@ to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code.
30
30
31
31
Clang-format options:
32
32
33
- --Werror - If set, changes formatting warnings to errors
34
- --Wno-error=<value> - If set don't error out on the specified warning type.
35
- =unknown - If set, unknown format options are only warned about.
36
- This can be used to enable formatting, even if the
37
- configuration contains unknown (newer) options.
38
- Use with caution, as this might lead to dramatically
39
- differing format depending on an option being
40
- supported or not.
41
- --assume-filename=<string> - Override filename used to determine the language.
42
- When reading from stdin, clang-format assumes this
43
- filename to determine the language.
44
- --cursor=<uint> - The position of the cursor when invoking
45
- clang-format from an editor integration
46
- --dry-run - If set, do not actually make the formatting changes
47
- --dump-config - Dump configuration options to stdout and exit.
48
- Can be used with -style option.
49
- --fallback-style=<string> - The name of the predefined style used as a
50
- fallback in case clang-format is invoked with
51
- -style=file, but can not find the .clang-format
52
- file to use.
53
- Use -fallback-style=none to skip formatting.
54
- --ferror-limit=<uint> - Set the maximum number of clang-format errors to
55
- emit before stopping (0 = no limit). Used only
56
- with --dry-run or -n
57
- -i - Inplace edit <file>s, if specified.
58
- --length=<uint> - Format a range of this length (in bytes).
59
- Multiple ranges can be formatted by specifying
60
- several -offset and -length pairs.
61
- When only a single -offset is specified without
62
- -length, clang-format will format up to the end
63
- of the file.
64
- Can only be used with one input file.
65
- --lines=<string> - <start line>:<end line> - format a range of
66
- lines (both 1-based).
67
- Multiple ranges can be formatted by specifying
68
- several -lines arguments.
69
- Can't be used with -offset and -length.
70
- Can only be used with one input file.
71
- -n - Alias for --dry-run
72
- --offset=<uint> - Format a range starting at this byte offset.
73
- Multiple ranges can be formatted by specifying
74
- several -offset and -length pairs.
75
- Can only be used with one input file.
76
- --output-replacements-xml - Output replacements as XML.
77
- --sort-includes - If set, overrides the include sorting behavior
78
- determined by the SortIncludes style flag
79
- --style=<string> - Coding style, currently supports:
80
- LLVM, Google, Chromium, Mozilla, WebKit.
81
- Use -style=file to load style configuration from
82
- .clang-format file located in one of the parent
83
- directories of the source file (or current
84
- directory for stdin).
85
- Use -style=file:<format_file_path> to load style
86
- configuration from a format file located at
87
- <format_file_path>. This path can be absolute or
88
- relative to the working directory.
89
- Use -style="{key: value, ...}" to set specific
90
- parameters, e.g.:
91
- -style="{BasedOnStyle: llvm, IndentWidth: 8}"
92
- --verbose - If set, shows the list of processed files
33
+ --Werror - If set, changes formatting warnings to errors
34
+ --Wno-error=<value> - If set don't error out on the specified warning type.
35
+ =unknown - If set, unknown format options are only warned about.
36
+ This can be used to enable formatting, even if the
37
+ configuration contains unknown (newer) options.
38
+ Use with caution, as this might lead to dramatically
39
+ differing format depending on an option being
40
+ supported or not.
41
+ --assume-filename=<string> - Override filename used to determine the language.
42
+ When reading from stdin, clang-format assumes this
43
+ filename to determine the language.
44
+ --cursor=<uint> - The position of the cursor when invoking
45
+ clang-format from an editor integration
46
+ --dry-run - If set, do not actually make the formatting changes
47
+ --dump-config - Dump configuration options to stdout and exit.
48
+ Can be used with -style option.
49
+ --fallback-style=<string> - The name of the predefined style used as a
50
+ fallback in case clang-format is invoked with
51
+ -style=file, but can not find the .clang-format
52
+ file to use.
53
+ Use -fallback-style=none to skip formatting.
54
+ --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
55
+ --files=<string> - Provide a list of files to run clang-format
56
+ -i - Inplace edit <file>s, if specified.
57
+ --length=<uint> - Format a range of this length (in bytes).
58
+ Multiple ranges can be formatted by specifying
59
+ several -offset and -length pairs.
60
+ When only a single -offset is specified without
61
+ -length, clang-format will format up to the end
62
+ of the file.
63
+ Can only be used with one input file.
64
+ --lines=<string> - <start line>:<end line> - format a range of
65
+ lines (both 1-based).
66
+ Multiple ranges can be formatted by specifying
67
+ several -lines arguments.
68
+ Can't be used with -offset and -length.
69
+ Can only be used with one input file.
70
+ -n - Alias for --dry-run
71
+ --offset=<uint> - Format a range starting at this byte offset.
72
+ Multiple ranges can be formatted by specifying
73
+ several -offset and -length pairs.
74
+ Can only be used with one input file.
75
+ --output-replacements-xml - Output replacements as XML.
76
+ --qualifier-alignment=<string> - If set, overrides the qualifier alignment style determined by the QualifierAlignment style flag
77
+ --sort-includes - If set, overrides the include sorting behavior determined by the SortIncludes style flag
78
+ --style=<string> - Coding style, currently supports:
79
+ LLVM, GNU, Google, Chromium, Microsoft, Mozilla, WebKit.
80
+ Use -style=file to load style configuration from
81
+ .clang-format file located in one of the parent
82
+ directories of the source file (or current
83
+ directory for stdin).
84
+ Use -style=file:<format_file_path> to explicitly specify
85
+ the configuration file.
86
+ Use -style="{key: value, ...}" to set specific
87
+ parameters, e.g.:
88
+ -style="{BasedOnStyle: llvm, IndentWidth: 8}"
89
+ --verbose - If set, shows the list of processed files
93
90
94
91
Generic Options:
95
92
96
- --help - Display available options (--help-hidden for more)
97
- --help-list - Display list of available options (--help-list-hidden for more)
98
- --version - Display the version of this program
93
+ --help - Display available options (--help-hidden for more)
94
+ --help-list - Display list of available options (--help-list-hidden for more)
95
+ --version - Display the version of this program
99
96
100
97
101
98
When the desired code formatting style is different from the available options,
0 commit comments