Skip to content

Commit

Permalink
precommit: fix problems when checking multiple files
Browse files Browse the repository at this point in the history
Change-Id: I44f5761e4f5e8e4f011a54f03464fc32db423686
  • Loading branch information
Christoph Rauch committed Jan 8, 2020
1 parent bae9453 commit a9722a8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
hooks:
- id: yapf
name: Check yapf
entry: scripts/check-yapf
entry: scripts/check-yapf -i
language: script
types: [file, python]
- id: pylint
Expand Down
1 change: 1 addition & 0 deletions scripts/check-mypy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is for execution by the pre-commit framework.
#
set -e -o pipefail

source "$(dirname $0)/lib-precommit"

Expand Down
5 changes: 3 additions & 2 deletions scripts/check-pylint
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is for execution by the pre-commit framework.
#
set -e -o pipefail

source "$(dirname $0)/lib-precommit"

Expand All @@ -13,9 +14,9 @@ PYTHON2_FILES=$(python_files 2 "$files")
PYTHON3_FILES=$(python_files 3 "$files")

if [ ! -z "$PYTHON3_FILES" ]; then
$PIPENV 3 run pylint "$PYTHON3_FILES"
$PIPENV 3 run pylint $PYTHON3_FILES
fi

if [ ! -z "$PYTHON2_FILES" ]; then
$PIPENV 2 run pylint "$PYTHON2_FILES"
$PIPENV 2 run pylint $PYTHON2_FILES
fi
4 changes: 2 additions & 2 deletions scripts/check-yapf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ PYTHON2_FILES=$(python_files 2 "$files")
PYTHON3_FILES=$(python_files 3 "$files")

if [ ! -z "$PYTHON3_FILES" ]; then
$PIPENV 3 run yapf $ARGS "$PYTHON3_FILES"
$PIPENV 3 run yapf $ARGS $PYTHON3_FILES
fi

if [ ! -z "$PYTHON2_FILES" ]; then
$PIPENV 2 run yapf $ARGS "$PYTHON2_FILES"
$PIPENV 2 run yapf $ARGS $PYTHON2_FILES
fi

0 comments on commit a9722a8

Please sign in to comment.