Skip to content

Commit c65777f

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 c65777f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/cfengine_cli/commands.py

Lines changed: 10 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(".")
@@ -143,6 +143,15 @@ def lint(files) -> int:
143143
return 1
144144

145145

146+
def lint(files) -> int:
147+
errors = _lint(files)
148+
if errors == 0:
149+
print("Success, no errors found.")
150+
else:
151+
print(f"Failure, {errors} errors in total.")
152+
return errors
153+
154+
146155
def report() -> int:
147156
_require_cfhub()
148157
_require_cfagent()

0 commit comments

Comments
 (0)