Skip to content

Commit 3e7ca15

Browse files
committed
lint: Added a printout of success / failure at the end of the command
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
1 parent 7077279 commit 3e7ca15

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/cfengine_cli/commands.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def _lint_single_arg(arg):
128128
return 0
129129

130130

131-
def lint(files) -> int:
131+
def _lint(files) -> int:
132132

133133
if not files:
134134
return _lint_folder(".")
@@ -142,6 +142,13 @@ def lint(files) -> int:
142142
return 0
143143
return 1
144144

145+
def lint(files) -> int:
146+
errors = _lint(files)
147+
if errors == 0:
148+
print("Success, no errors found.")
149+
else:
150+
print(f"Failure, {errors} errors in total.")
151+
return errors
145152

146153
def report() -> int:
147154
_require_cfhub()

0 commit comments

Comments
 (0)