Skip to content

Commit

Permalink
Make Travis check formatting with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed May 23, 2019
1 parent 43ef61a commit e71929a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,18 @@ are fixing a new issue feel free to file an issue and then reference it in the P
You can [browse open issues](https://github.com/lmcinnes/umap/issues),
or consult the [project roadmap](https://github.com/lmcinnes/umap/issues/15), for potential code
contributions. Fixes for issues tagged with 'help wanted' are especially appreciated.

### Code formatting

If possible, install the [black code formatter](https://github.com/python/black) (e.g.
`pip install black`) and run it before submitting a pull request. This helps maintain consistency
across the code, but also there is a check in the Travis-CI continuous integration system which
will show up as a failure in the pull request if `black` detects that it hasn't been run.

Formatting is as simple as running:

```bash
black .
```

in the root of the project.
1 change: 1 addition & 0 deletions ci_scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if [[ "$DISTRIB" == "conda" ]]; then

source activate testenv

pip install black

if [[ "$COVERAGE" == "true" ]]; then
pip install coverage coveralls
Expand Down
4 changes: 4 additions & 0 deletions ci_scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
set -e

if [[ "$COVERAGE" == "true" ]]; then
black --check $MODULE
fi

# Get into a temp directory to run test from the installed scikit learn and
# check if we do not leave artifacts
mkdir -p $TEST_DIR
Expand Down

0 comments on commit e71929a

Please sign in to comment.