Skip to content

Commit

Permalink
Fix checks. Add error message to recommend people to use pre-commit
Browse files Browse the repository at this point in the history
hooks.
  • Loading branch information
shyuep committed Sep 12, 2019
1 parent b5085dc commit c591a19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ jobs:
# Add executables and path.
for EXEPATH in `pwd`/cmd_line/*/Linux_64bit; do export PATH=$PATH:$EXEPATH; done
pip install --quiet -e .
echo "Checks will be performed in the order of pycodestyle -> pydocstyle -> mypy"
echo "It is highly recommended that you use the pre-commit hook provided in pymatgen (simply copy pre-commit to .git/hooks) to check before pushing your code."
echo "pycodestyle checks..."
pycodestyle pymatgen
echo "--- Done ---"
export MODIFIED_FILES=`git diff --diff-filter=d --name-only HEAD v2019.9.12 | grep -E '\.(py)'`
export MODIFIED_FILES=`git diff --diff-filter=d --name-only HEAD v2019.9.12 | grep -E '\.(py)' | tr '\n' ' '`
echo "pydocstyle checks for $MODIFIED_FILES..."
pydocstyle --count pymatgen/core $MODIFIED_FILES
echo "--- Done ---"
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ before_script:
script:
- export PATH="$HOME/miniconda/bin:$PATH"
- source activate test-environment
- echo "pycodestyle followed by tests... Note that if codestyle fails, tests will not be run and you need to fix codestyle first."
- travis_wait 28800 pycodestyle pymatgen && pydocstyle --count pymatgen/core && mypy pymatgen && pytest $EXCLUDE_TESTS pymatgen
- export MODIFIED_FILES=`git diff --diff-filter=d --name-only HEAD v2019.9.12 | grep -E '\.(py)' | tr '\n' ' '`
- echo "pycodestyle->pydocstyle->mypy->pytest... Note that this fails on the first command with error."
- echo "It is highly recommended that you use the pre-commit hook provided in pymatgen (simply copy pre-commit to .git/hooks) to check before pushing your code."
- travis_wait 28800 pycodestyle pymatgen && pydocstyle --count pymatgen/core $MODIFIED_FILES && mypy pymatgen && pytest $EXCLUDE_TESTS pymatgen
notifications:
email:
recipients:
Expand Down

0 comments on commit c591a19

Please sign in to comment.