Repository navigation
Expand file tree
/
Copy path.cmake-format.py
More file actions
76 lines (62 loc) · 2.19 KB
/
Copy path.cmake-format.py
File metadata and controls
76 lines (62 loc) · 2.19 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
# -*- Python -*-
with section("format"):
# How wide to allow formatted cmake files
line_width = 100
# How many spaces to tab for indent
tab_size = 2
# If true, separate flow control names from their parentheses with a space
separate_ctrl_name_with_space = False
# If true, separate function names from parentheses with a space
separate_fn_name_with_space = False
# If a statement is wrapped to more than one line, then dangle the closing
# parenthesis on its own line.
dangle_parens = False
# If a positional argument group contains more than this many arguments, then
# force it to a vertical layout.
max_pargs_hwrap = 3
# Force vertical alignment if command takes more than this number of lines
max_rows_cmdline = 1
# List of command names which should always be wrapped
always_wrap = ['configure_package_config_file',
'list',
'set_target_properties',
'target_include_directories',
'target_link_libraries',
'FILES',
'HEADERS',
'INCLUDE_DIRECTORIES',
'LINK_LIBRARIES',
'NAMES',
'PATHS',
'PATH_SUFFIXES',
'SOURCES'
]
with section("parse"):
# Formatting for custom macros
additional_commands = {
"gridkit_add_library": {
"pargs": 1, # Number of initial positional arguments
"flags": [],
"kwargs": {
"SOURCES": "*",
"HEADERS": "*",
"LINK_LIBRARIES": "*",
"INCLUDE_DIRECTORIES": "*",
"COMPILE_OPTIONS": "*",
}
},
"enzyme_build_object": {
"flags": [],
"kwargs": {
"NAME": 1,
"SOURCES": "*",
"LINK_LIBRARIES": "*",
"INCLUDE_DIRECTORIES": "*",
}
}
}
with section("markup"):
# Globally disable comment markup processing
enable_markup = False
# Do not reflow the first comment block in each file
first_comment_is_literal = True