-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.cmake-format.yaml
More file actions
172 lines (136 loc) · 5.44 KB
/
.cmake-format.yaml
File metadata and controls
172 lines (136 loc) · 5.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# ─── cmake-format configuration ───────────────────────────────────
# Docs: https://cmake-format.readthedocs.io/en/latest/configuration.html
# Repo: https://github.com/cheshirekow/cmake_format
#
# Styled to match the project's .clang-format philosophy.
# Clang-format equivalents noted with "cf." where applicable.
#
# AlignConsecutiveAssignments / AlignConsecutiveDeclarations have
# no cmake-format equivalent. Use format-off guards:
# # cmake-format: off
# set(short "aaa")
# set(longer "bbb")
# # cmake-format: on
# ───────────────────────────────────────────────────────────────────
parse:
additional_commands: {}
override_spec: {}
vartags: []
proptags: []
format:
disable: false
# cf. ColumnLimit: 80
line_width: 80
# cf. IndentWidth: 4
tab_size: 4
# cf. UseTab: Never
use_tabchars: false
# cf. (no equivalent — rounding strategy for fractional indents)
fractional_tab_policy: use-space
# cf. BinPackArguments: false / BinPackParameters: OnePerLine
# cmake-format already uses one-per-line once vertical layout
# triggers. These thresholds control WHEN to trigger it.
# Lower values = wrap sooner = closer to "no bin-packing."
max_subgroups_hwrap: 2
max_pargs_hwrap: 3
# cf. (no equivalent — nest if cmdline positional group > N lines)
max_rows_cmdline: 1
# cf. (no equivalent — reject horizontal if > N lines)
# Low value forces vertical layout earlier, matching the
# "one per line when wrapping" philosophy.
max_lines_hwrap: 2
# cf. SpaceBeforeParens: ControlStatements
# clang-format adds a space before parens for control flow:
# if (x) ← C++
# CMake convention is no space:
# if(x) ← CMake
# CMake convention takes precedence over clang-format parity.
separate_ctrl_name_with_space: false
separate_fn_name_with_space: false
# cf. BraceWrapping.AfterFunction: true
# Closing ')' gets its own line for wrapped statements.
dangle_parens: false
# cf. AlignAfterOpenBracket: Align
# prefix → ')' aligns with command name column
# prefix-indent → one tab past command name
# child → column of deepest child argument
dangle_align: prefix
# Layout heuristics for nested vs un-nested.
min_prefix_chars: 4
max_prefix_chars: 10
# cf. (no equivalent — commands lowercase, keywords UPPER)
command_case: lower
keyword_case: upper
# cf. SortIncludes: { Enabled: true, IgnoreCase: false }
enable_sort: true
autosort: true
# cf. (no equivalent)
line_ending: unix
always_wrap: []
require_valid_layout: false
layout_passes: {}
markup:
# cf. (no equivalent)
bullet_char: "*"
enum_char: .
# Preserve the first comment block verbatim (copyright headers).
first_comment_is_literal: true
literal_comment_pattern: null
fence_pattern: '^\s*([`~]{3}[`~]*)(.*)$'
ruler_pattern: '^\s*[^\w\s]{3}.*[^\w\s]{3}$'
explicit_trailing_pattern: "#<"
hashruler_min_length: 10
canonicalize_hashrulers: true
# cf. ReflowComments: Always
# clang-format reflows comments to fit the column limit.
# cmake-format's enable_markup is more destructive — it parses
# bullet lists, section headers, and restructured text, and can
# mangle structured comments (ASCII tables, diagrams, doxygen).
# Disabled for safety. Enable only if all CMake comments are
# plain prose paragraphs.
enable_markup: false
lint:
disabled_codes: []
# ── Naming conventions (no clang-format equivalent) ───────
# clang-format does not enforce naming. These follow the
# project's Boost C++ convention:
# snake_case for all non-global identifiers.
# UPPER_SNAKE_CASE for globals / publics / keywords.
# Leading underscores prohibited in all scopes.
# Functions: snake_case
function_pattern: "[a-z_][a-z0-9_]+"
# Macros: snake_case (CMake macros ≠ C preprocessor macros)
macro_pattern: "[a-z_][a-z0-9_]+"
# Global variables (CMAKE_*, project cache): UPPER, no leading _
global_var_pattern: "[A-Z][0-9A-Z_]+"
# Internal variables: snake_case, no leading _
internal_var_pattern: "[a-z][a-z0-9_]+"
# Local variables: snake_case, no leading _
local_var_pattern: "[a-z][a-z0-9_]+"
# Private variables: snake_case, no leading _
private_var_pattern: "[a-z][a-z0-9_]+"
# Public variables (option(), cache): UPPER, no leading _
public_var_pattern: "[A-Z][0-9A-Z_]+"
# Function/macro argument variables: snake_case, no leading _
argument_var_pattern: "[a-z][a-z0-9_]+"
# Keyword arguments: UPPER_SNAKE_CASE
keyword_pattern: "[A-Z][0-9A-Z_]+"
max_conditionals_custom_parser: 2
# cf. MaxEmptyLinesToKeep: 1
# cmake-format counts newlines, not blank lines:
# 1 newline = consecutive lines (no blank line)
# 2 newlines = 1 blank line between statements
# MaxEmptyLinesToKeep: 1 → max_statement_spacing: 2
min_statement_spacing: 1
max_statement_spacing: 2
max_returns: 6
max_branches: 12
max_arguments: 5
max_localvars: 15
max_statements: 50
encode:
emit_byteorder_mark: false
input_encoding: utf-8
output_encoding: utf-8
misc:
per_command: {}