Skip to content

Commit 2b67021

Browse files
committed
cfengine dev format-docs: Removed ability to specify files and folders
Align with cfengine dev lint-docs and keep things as simple as possible. This command is intended to be run inside docs repo, without args. Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent de1e643 commit 2b67021

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/cfengine_cli/dev.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def print_dependency_tables(args) -> int:
4747
return print_release_dependency_tables(args.versions)
4848

4949

50-
def format_docs(files) -> int:
50+
def format_docs() -> int:
5151
_expect_repo("documentation")
52-
ret = docs.format_docs(files)
52+
ret = docs.format_docs()
5353
return ret
5454

5555

@@ -73,7 +73,7 @@ def dispatch_dev_subcommand(subcommand, args) -> int:
7373
if subcommand == "print-dependency-tables":
7474
return print_dependency_tables(args)
7575
if subcommand == "format-docs":
76-
return format_docs(args.files)
76+
return format_docs()
7777
if subcommand == "lint-docs":
7878
return lint_docs()
7979
if subcommand == "syntax-tree":

src/cfengine_cli/docs.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ def _format_docs_single_arg(path):
449449
return formatted
450450

451451

452-
def format_docs(paths) -> int:
452+
def format_docs() -> int:
453453
"""
454-
Iterate through entire docs repo, or specified subfolders / files, autoformatting as much as possible:
454+
Iterate through entire docs repo (CWD) autoformatting as much as possible:
455455
- python code with black
456456
- markdown files with prettier
457457
- code blocks inside markdown files are formatted for the formats supported by prettier
@@ -460,11 +460,7 @@ def format_docs(paths) -> int:
460460
Run by the command:
461461
cfengine dev format-docs
462462
"""
463-
if not paths:
464-
_format_docs_single_arg(".")
465-
return 0
466-
for path in paths:
467-
_format_docs_single_arg(path)
463+
_format_docs_single_arg(".")
468464
return 0
469465

470466

0 commit comments

Comments
 (0)