Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions norminette/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def main():
help="By default norminette displays the full path to the file, this allows to show only filename",
default=False,
)
parser.add_argument(
"-E",
"--only-errors",
action="store_true",
help="Display only errors instead of every file result",
)
parser.add_argument(
"-v",
"--version",
Expand Down Expand Up @@ -141,6 +147,8 @@ def main():
sys.exit(1)
except KeyboardInterrupt:
sys.exit(1)
if args.only_errors:
files = list(filter(lambda file: file.errors.status != "OK", files))
errors = format(files, use_colors=not args.no_colors)
print(errors, end="")
sys.exit(1 if any(len(it.errors) for it in files) else 0)
Expand Down