Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed pre-commit.sh to style-check.sh and clarified PR instructions. (
#306)
- Loading branch information
Showing
3 changed files
with
23 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
# run this to perform code-style checking. | ||
|
||
# Run pylint on the sockeye package, failing on any reported errors. | ||
pylint --rcfile=pylintrc sockeye -E | ||
SOCKEYE_LINT_RESULT=$? | ||
|
||
# Run pylint on test package, failing on any reported errors. | ||
pylint --rcfile=pylintrc test -E | ||
TESTS_LINT_RESULT=$? | ||
|
||
# Run mypy, we are currently limiting to modules in typechecked-files | ||
mypy --ignore-missing-imports --follow-imports=silent @typechecked-files | ||
MYPY_RESULT=$? | ||
|
||
[ $SOCKEYE_LINT_RESULT -ne 0 ] && echo 'pylint found errors in the sockeye package' && exit 1 | ||
[ $TESTS_LINT_RESULT -ne 0 ] && echo 'pylint found errors in the test package' && exit 1 | ||
[ $MYPY_RESULT -ne 0 ] && echo 'mypy found incorrect type usage' && exit 1 | ||
|
||
echo 'all style checks passed' | ||
exit 0 |