Skip to content

Commit

Permalink
Exclude mlflow/protos (#5036)
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy committed Nov 10, 2021
1 parent 1e62d2f commit f9aff40
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set -ex
diff=$(git diff --cached --name-only | grep '\.py$' || true)

if [ ! -z "$diff" ]; then
black --check $diff
# We specify `--exclude` option in `pyproject.toml`,
# but it's only consulted for recursive search, not for files passed on the command line:
# https://github.com/psf/black/issues/438#issuecomment-413886281
# `--force-exclude` option can solve this issue, but black >= 20.8b0 is required:
# https://black.readthedocs.io/en/stable/change_log.html#id26
# TODO: Upgrade black to >= 20.8b0 and use `--force-exclude`
black --check $(echo $diff | grep -v '^mlflow/protos')
pylint $diff
fi

0 comments on commit f9aff40

Please sign in to comment.