diff --git a/tools/lint b/tools/lint index d9691c6..56c096c 100755 --- a/tools/lint +++ b/tools/lint @@ -1,6 +1,7 @@ #! /usr/bin/env python3 import argparse +import re import sys from zulint.command import LinterConfig, add_default_linter_arguments @@ -44,6 +45,15 @@ def run() -> None: description="Sorts Python import statements", check_arg=["--check-only", "--diff"], ) + linter_config.external_linter( + "black", + ["black"], + ["py"], + description="Reformats Python code", + check_arg=["--check"], + suppress_line=lambda line: line == "All done! ✨ 🍰 ✨\n" + or re.fullmatch(r"\d+ files? would be left unchanged\.\n", line) is not None, + ) @linter_config.lint def custom_py() -> int: