Skip to content

Commit

Permalink
Renamed pre-commit.sh to style-check.sh and clarified PR instructions. (
Browse files Browse the repository at this point in the history
  • Loading branch information
fhieber committed Feb 28, 2018
1 parent 7e3c66d commit 9089e98
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -6,7 +6,7 @@ until you can check this box.
- [ ] Unit tests pass (`pytest`)
- [ ] Were system tests modified? If so did you run these at least 5 times to account for the variation across runs?
- [ ] System tests pass (`pytest test/system`)
- [ ] Passed code style checking (`./pre-commit.sh` or manual run of pylint & mypy)
- [ ] Passed code style checking (`./style-check.sh`)
- [ ] You have considered writing a test
- [ ] Updated major/minor version in `sockeye/__init__.py`. Major version bump if this is a backwards incompatible change.
- [ ] Updated CHANGELOG.md
Expand Down
47 changes: 0 additions & 47 deletions pre-commit.sh

This file was deleted.

22 changes: 22 additions & 0 deletions style-check.sh
@@ -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

0 comments on commit 9089e98

Please sign in to comment.