Skip to content

Commit

Permalink
Merge pull request #25 from gis-ops/fix-linting-stuff
Browse files Browse the repository at this point in the history
replace yapf with black
  • Loading branch information
nilsnolde authored Jun 21, 2021
2 parents 801bb5b + 77d2af1 commit 838d328
Show file tree
Hide file tree
Showing 39 changed files with 2,601 additions and 2,315 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ jobs:
run: |
source $HOME/.poetry/env
poetry install
- name: linting
- name: style & lint checks
run: |
source .venv/bin/activate
yapf -r -vv --diff -p routingpy tests
flake8 .
pre-commit run
- name: nosetests
run: |
source .venv/bin/activate
Expand Down
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
repos:
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0 # Use the sha / tag you want to point at
- repo: https://github.com/psf/black
rev: 21.6b0
hooks:
- id: yapf
args: [-vv, -r, -p, routingpy, tests]
- id: black
language_version: python3
# temp exlude osrm: black fails to reformat for some reason
args: [--check, routingpy, tests, --exclude, routingpy/routers/mapbox_osrm.py]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4 # pick a git hash / tag to point to
rev: 3.9.0 # pick a git hash / tag to point to
hooks:
- id: flake8
9 changes: 0 additions & 9 deletions .style.yapf

This file was deleted.

8 changes: 3 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ eventually be able to cover all remote routing API's, but have to rely on commun

We welcome patches and fixes to existing clients and want to make sure everything goes smoothly for you while submitting a PR.

We use Google's [`yapf`](https://github.com/google/yapf) to make sure the formatting is consistent.
We use the PSF's [`black`](https://github.com/psf/black) to make sure the code style is consistent, and `flake8` as a linter.

When contributing, we expect you to:

Expand Down Expand Up @@ -54,12 +54,10 @@ poetry install
nosetests -v
```

4. Please add a pre-commit hook for `yapf`, so your code gets auto-formatted before committing it:
4. Please install the pre-commit hook, so your code gets auto-formatted and linted before committing it:
```bash
# From the root of your git project
curl -o pre-commit.sh https://raw.githubusercontent.com/google/yapf/master/plugins/pre-commit.sh
chmod a+x pre-commit.sh
mv pre-commit.sh .git/hooks/pre-commit
pre-commit install
```

### Tests
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ routing-py
==========

.. image:: https://github.com/gis-ops/routing-py/workflows/tests/badge.svg
:target: https://github.com/gis-ops/routing-py/workflows
:target: https://github.com/gis-ops/routing-py/actions/workflows/ci-tests.yml
:alt: tests

.. image:: https://coveralls.io/repos/github/gis-ops/routing-py/badge.svg?branch=master
Expand Down Expand Up @@ -35,14 +35,14 @@ or **time-distance matrices**.
- `Local Valhalla`_
- `Local OSRM`_

This list is hopefully growing with time and contributions by other developers. An up-to-date list is always availaable
This list is hopefully growing with time and contributions by other developers. An up-to-date list is always available
in our documentation_.

**routing-py** is tested against CPython versions 3.7, 3.8, 3.9 and against PyPy3. As other major libraries like ``numpy``
and ``pandas`` decided to drop Python 2 support, we did not see any reason to burden the project with the compatibility
weight.

© routing-py contributors 2020 under the `Apache 2.0 License`_.
© routing-py contributors 2021 under the `Apache 2.0 License`_.

.. image:: https://user-images.githubusercontent.com/10322094/57357720-e180c080-7173-11e9-97a4-cecb4670065d.jpg
:alt: routing-py-image
Expand Down
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

4 changes: 0 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ Welcome to routingpy's documentation!
:Documentation: https://routingpy.readthedocs.io/
:Source Code: https://github.com/gis-ops/routing-py
:Issue Tracker: https://github.com/gis-ops/routing-py/issues
:Stack Overflow: https://stackoverflow.com/questions/tagged/routingpy
:PyPI: https://pypi.org/project/routingpy
:Conda: https://conda.org/gis-ops/routingpy
:MyBinder Interactive Examples: https://mybinder.org/v2/gh/gis-ops/routing-py/master?filepath=examples

.. automodule:: routingpy
Expand All @@ -25,8 +23,6 @@ Installation
::

pip install routingpy
# or
conda install routingpy

Routers
~~~~~~~~~
Expand Down
Loading

0 comments on commit 838d328

Please sign in to comment.