Skip to content

Commit

Permalink
chore(ci): add isort and flake8-quotes linters
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdanp committed Apr 22, 2018
1 parent 396565b commit 313e637
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python:
- "nightly"
matrix:
include:
- { python: "3.6", env: TOXENV=flake8 }
- { python: "3.6", env: TOXENV=lint }
allow_failures:
- python: "3.6-dev"
- python: "3.7-dev"
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ open an issue and let someone else do that work.
### Pull Requests

* Make sure any code changes are covered by tests.
* Run [isort] on any modified files.
* If this is your first contribution, add yourself to the [CONTRIBUTORS] file.
* If your branch is behind master, [rebase] on top of it.

Expand All @@ -25,6 +26,7 @@ Run the test suite with `tox`. The tests require running [RabbitMQ],
[RabbitMQ]: https://www.rabbitmq.com/
[Redis]: https://redis.io
[Memcached]: https://memcached.org/
[isort]: https://github.com/timothycrosley/isort
[rebase]: https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request


Expand Down
3 changes: 3 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
flake8
flake8-quotes
hiredis # Not included in the base distro because of PyPy
isort
twine

-r common.txt
Expand Down
9 changes: 8 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ max-line-length = 120
[flake8]
ignore = E402,F403,F811
max-complexity = 20
max-line-length = 120
max-line-length = 120

inline-quotes = "
multiline-quotes = """

[isort]
known_first_party=dramatiq
multi_line_output=5
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ envlist=
py{35,36,37}-cpython
pypy3-pypy
benchmarks
flake8
lint

[testenv]
deps=
cpython: -r{toxinidir}/requirements/dev.txt
pypy: -r{toxinidir}/requirements/dev-pypy.txt
flake8: flake8
lint: isort
flake8
flake8-quotes
commands=
py.test --benchmark-skip {posargs}
passenv=
Expand All @@ -27,6 +29,7 @@ commands=
install_command=
pip install -U -c {toxinidir}/requirements/constraints.txt {opts} {packages}

[testenv:flake8]
[testenv:lint]
commands=
flake8 {toxinidir}/dramatiq {toxinidir}/examples {toxinidir}/tests
isort -rc -c {toxinidir}/dramatiq {toxinidir}/examples {toxinidir}/tests

0 comments on commit 313e637

Please sign in to comment.