Skip to content

Commit 39b898e

Browse files
committed
Add indent parameter to format subcommand
1 parent d842ba0 commit 39b898e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/cfengine_cli/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def autoformat(node, fmt, args, macro_indent, indent=0):
188188
"promise",
189189
"attribute",
190190
]:
191-
indent += 2
191+
indent += args.indent
192192
if node.type == "attribute":
193193
lines = stringify(node, indent, args)
194194
fmt.print_lines(lines, indent=0)

src/cfengine_cli/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def _get_arg_parser():
4646
fmt.add_argument(
4747
"--max-line-length", default=80, type=int, help="Maximum line length"
4848
)
49+
fmt.add_argument("--indent", default=2, type=int, help="Indentation increase")
4950
subp.add_parser(
5051
"lint",
5152
help="Look for syntax errors and other simple mistakes",

0 commit comments

Comments
 (0)