Skip to content

Commit

Permalink
Update base for Update on "Return non-zero exit codes for violations/…
Browse files Browse the repository at this point in the history
…errors"

This tracks exit codes based on the existence of violations and/or
errors when linting files.

- 0: everything clean
- 1: violations only
- 2: errors only
- 3: both violations and errors

Fixes #258

[ghstack-poisoned]
  • Loading branch information
amyreese committed Mar 15, 2023
1 parent 8e7aca3 commit 4cfb2c6
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/fixit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,8 @@ def lint(
"""
lint one or more paths and return suggestions
"""
exit_code = 0
for result in fixit_paths(paths):
if result.violation:
exit_code |= 1
if result.error:
exit_code |= 2
print_result(result, ctx.obj.debug)
ctx.exit(exit_code)


@main.command()
Expand Down

0 comments on commit 4cfb2c6

Please sign in to comment.