Skip to content

Commit

Permalink
Added .pre-commit-config.yaml and Contributing docs section. (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdolemelipone committed Jun 19, 2023
1 parent 1d14f2a commit 6672c1d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
20 changes: 20 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,23 @@ Then within ``order_and_items.html``, render the formset like this:
</form>

.. quick-examples-end
Contributing
------------

Pull requests are welcome. To run all tests locally, setup a virtual environment and run


.. code-block:: sh
tox
Before committing, use ``pre-commit`` to check all formatting and linting

.. code-block:: sh
pip install pre-commit
pre-commmit install
This will automatically run ``black``, ``isort`` and ``flake8`` before the commit is accepted.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ source = extra_views

[flake8]
max-complexity = 10
extend-exclude = extra_views_tests/migrations/, build/lib/, docs, venv, .venv
extend-exclude = extra_views_tests/migrations/, build/lib/, docs/conf.py, venv, .venv
ignore = W191, W503, E203
max-line-length = 88

Expand Down

0 comments on commit 6672c1d

Please sign in to comment.