Skip to content

Commit

Permalink
Add code format configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
laughingman7743 committed May 2, 2020
1 parent 8453395 commit 1d7169f
Show file tree
Hide file tree
Showing 6 changed files with 370 additions and 206 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.PHONY: fmt
fmt:
pipenv run isort -rc .
pipenv run black .

.PHONY: chk
chk:
pipenv run isort -c -rc .
pipenv run black --check --diff .
5 changes: 5 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[pipenv]
allow_prereleases = true

[packages]
e1839a8 = {path = ".",extras = ["sqlalchemy", "pandas"],editable = true}

Expand All @@ -14,4 +17,6 @@ wheel = "*"
pytest = ">=3.5"
pytest-cov = "*"
pytest-flake8 = ">=1.0.1"
pytest-black = "*"
pytest-isort = "*"
pytest-xdist = "*"
525 changes: 322 additions & 203 deletions Pipfile.lock

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
.. image:: https://img.shields.io/pypi/l/PyAthena.svg
:target: https://github.com/laughingman7743/PyAthena/blob/master/LICENSE

.. image:: https://img.shields.io/pypi/dm/PyAthena.svg
:target: https://pypistats.org/packages/pyathena
.. image:: https://pepy.tech/badge/pyathena/month
:target: https://pepy.tech/project/pyathena/month

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

PyAthena
========
Expand Down Expand Up @@ -828,3 +830,25 @@ Run test multiple Python versions
$ pyenv local 3.8.2 3.7.2 3.6.8 3.5.7 2.7.16
$ pipenv run tox
$ pipenv run scripts/test_data/delete_test_data.sh
Code formatting
---------------

The code formatting uses `black`_ and `isort`_.

Appy format
~~~~~~~~~~~

.. code:: bash
$ make fmt
Check format
~~~~~~~~~~~~

.. code:: bash
$ make chk
.. _`black`: https://github.com/psf/black
.. _`isort`: https://github.com/timothycrosley/isort
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ universal = 1

[tool:pytest]
flake8-max-line-length = 100

[isort]
line_length = 100
order_by_type = True
multi_line_output = 4
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ deps =
pytest>=3.5
pytest-cov
pytest-flake8>=1.0.1
pytest-black
pytest-isort
pytest-xdist
commands =
pytest --cov pyathena --cov-report html --cov-report term --flake8
pytest --cov pyathena --cov-report html --cov-report term --flake8 --black --isort
passenv =
AWS_*

0 comments on commit 1d7169f

Please sign in to comment.