forked from gnuradio/volk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds `.cmake-format.py`. It is mostly inspired by the GNU Radio version of it. Steps to reproduce these results: - `pip3 install cmakelang` - `cmake-format --dump-config python > .cmake-format.py` - Modify .cmake-format.py to be close to the GNU Radio version. - `cmake-format -c .cmake-format.py -i $(git ls-files | grep CMakeLists.txt) $(git ls-files | grep .cmake)` Fixes gnuradio#600 Fixes gnuradio#423 Signed-off-by: Johannes Demel <[email protected]>
- Loading branch information
Showing
26 changed files
with
1,318 additions
and
986 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Copyright 2023 Johannes Demel | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
# ---------------------------------- | ||
# Options affecting listfile parsing | ||
# ---------------------------------- | ||
with section("parse"): | ||
additional_commands = { | ||
"gr_python_install": { | ||
"flags": [], | ||
"kwargs": {"PROGRAMS": "*", "FILES": "*", "DESTINATION": "*"}, | ||
}, | ||
} | ||
|
||
|
||
with section("format"): | ||
# Disable formatting entirely, making cmake-format a no-op | ||
disable = False | ||
|
||
# How wide to allow formatted cmake files | ||
line_width = 80 | ||
|
||
# How many spaces to tab for indent | ||
tab_size = 2 | ||
|
||
# If true, lines are indented using tab characters (utf-8 0x09) instead of | ||
# <tab_size> space characters (utf-8 0x20). In cases where the layout would | ||
# require a fractional tab character, the behavior of the fractional | ||
# indentation is governed by <fractional_tab_policy> | ||
use_tabchars = False | ||
|
||
# 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, than dangle the closing | ||
# parenthesis on its own line. | ||
dangle_parens = False | ||
|
||
# If the statement spelling length (including space and parenthesis) is | ||
# smaller than this amount, then force reject nested layouts. | ||
min_prefix_chars = tab_size | ||
|
||
# If the statement spelling length (including space and parenthesis) is larger | ||
# than the tab width by more than this amount, then force reject un-nested | ||
# layouts. | ||
max_prefix_chars = 3 * tab_size | ||
|
||
# What style line endings to use in the output. | ||
line_ending = "unix" | ||
|
||
# Format command names consistently as 'lower' or 'upper' case | ||
command_case = "canonical" | ||
|
||
# Format keywords consistently as 'lower' or 'upper' case | ||
keyword_case = "upper" | ||
|
||
|
||
with section("markup"): | ||
first_comment_is_literal = True | ||
enable_markup = False | ||
|
||
|
||
with section("lint"): | ||
max_arguments = 6 | ||
max_localvars = 20 | ||
max_statements = 75 |
Oops, something went wrong.