Make linter print useful output when failing on precommit
* Make linter print useful output when failing on precommit * Update Scripts/precommit.py Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
This commit is contained in:
parent
3bf5b8ed10
commit
e90639bcab
@ -257,12 +257,17 @@ def lint_swift_files(file_paths: set[str]) -> None:
|
||||
lint_output = error.output
|
||||
print(lint_output)
|
||||
|
||||
lint_output = subprocess.check_output(
|
||||
["swiftlint", "lint", "--strict", "--use-script-input-files"],
|
||||
env=env,
|
||||
text=True,
|
||||
)
|
||||
print(lint_output)
|
||||
try:
|
||||
lint_output = subprocess.check_output(
|
||||
["swiftlint", "lint", "--strict", "--use-script-input-files"],
|
||||
env=env,
|
||||
text=True,
|
||||
)
|
||||
print(lint_output)
|
||||
except subprocess.CalledProcessError as error:
|
||||
print(error.output)
|
||||
print("Please fix the above lint errors before committing your changes")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def check_diff_for_keywords():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user