Skip to content

Commit

Permalink
Updated files with 'repo_helper'. (#15)
Browse files Browse the repository at this point in the history
Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com>
  • Loading branch information
repo-helper[bot] committed Jan 28, 2021
1 parent 19662e3 commit 177e9ca
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
python -VV
python -m site
python -m pip install --upgrade pip setuptools wheel
python -m pip install tox
python -m pip install --upgrade tox virtualenv
- name: "Run mypy"
run: "python -m tox -e mypy"
40 changes: 0 additions & 40 deletions .isort.cfg

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ repos:
- id: remove-crlf
- id: forbid-crlf

- repo: https://github.com/domdfcoding/yapf-isort
rev: v0.5.5
- repo: https://github.com/repo-helper/formate
rev: v0.2.0
hooks:
- id: yapf-isort
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.py$
- id: formate
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.(_)?py$

- repo: https://github.com/domdfcoding/dep_checker
rev: v0.4.1
Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Contributing

.. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md
``extras_require`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging, and `pre-commit <https://pre-commit.com>`_ to maintain code quality.
``extras_require`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging,
and `pre-commit <https://pre-commit.com>`_ to maintain code quality.

Install ``pre-commit`` with ``pip`` and install the git hook:

Expand All @@ -17,13 +18,13 @@ Install ``pre-commit`` with ``pip`` and install the git hook:
Coding style
--------------

`yapf-isort <https://pypi.org/project/yapf-isort/>`_ is used for code formatting.
`formate <https://formate.readthedocs.io>`_ is used for code formatting.

It can be run manually via ``pre-commit``:

.. code-block:: bash
$ pre-commit run yapf-isort -a
$ pre-commit run formate -a
Or, to run the complete autoformatting suite:
Expand All @@ -36,7 +37,8 @@ Or, to run the complete autoformatting suite:
Automated tests
-------------------

Tests are run with ``tox`` and ``pytest``. To run tests for a specific Python version, such as Python 3.6, run:
Tests are run with ``tox`` and ``pytest``.
To run tests for a specific Python version, such as Python 3.6:

.. code-block:: bash
Expand Down
10 changes: 6 additions & 4 deletions doc-source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Overview

.. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md
``extras_require`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging, and `pre-commit <https://pre-commit.com>`_ to maintain code quality.
``extras_require`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging,
and `pre-commit <https://pre-commit.com>`_ to maintain code quality.

Install ``pre-commit`` with ``pip`` and install the git hook:

Expand All @@ -16,13 +17,13 @@ Install ``pre-commit`` with ``pip`` and install the git hook:
Coding style
--------------

`yapf-isort <https://pypi.org/project/yapf-isort/>`_ is used for code formatting.
`formate <https://formate.readthedocs.io>`_ is used for code formatting.

It can be run manually via ``pre-commit``:

.. prompt:: bash

pre-commit run yapf-isort -a
pre-commit run formate -a


Or, to run the complete autoformatting suite:
Expand All @@ -35,7 +36,8 @@ Or, to run the complete autoformatting suite:
Automated tests
-------------------

Tests are run with ``tox`` and ``pytest``. To run tests for a specific Python version, such as Python 3.6, run:
Tests are run with ``tox`` and ``pytest``.
To run tests for a specific Python version, such as Python 3.6:

.. prompt:: bash

Expand Down
59 changes: 59 additions & 0 deletions formate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[hooks]
dynamic_quotes = 10
collections-import-rewrite = 20
reformat-generics = 40
noqa-reformat = 60
ellipsis-reformat = 70

[config]
indent = "\t"
line_length = 115

[hooks.yapf]
priority = 30

[hooks.isort]
priority = 50

[hooks.yapf.kwargs]
yapf_style = ".style.yapf"

[hooks.isort.kwargs]
line_length = 115
indent = "\"\t\t\""
multi_line_output = 8
import_heading_stdlib = "stdlib"
import_heading_thirdparty = "3rd party"
import_heading_firstparty = "this package"
import_heading_localfolder = "this package"
balanced_wrapping = false
lines_between_types = 0
use_parentheses = true
remove_redundant_aliases = true
default_section = "THIRDPARTY"
known_third_party = [
"beautifulsoup4",
"coincidence",
"coverage",
"coverage_pyver_pragma",
"docutils",
"docutils_stubs",
"domdf_python_tools",
"github",
"html5lib",
"packaging",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_regressions",
"pytest_rerunfailures",
"pytest_timeout",
"pytoml",
"pytz",
"requests",
"setuptools",
"sphinx",
"sphinx_prompt",
"sphinx_toolbox",
]
known_first_party = "sphinxcontrib.extras_require"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=40.6.0", "wheel>=0.34.2"]
requires = [ "setuptools>=40.6.0", "wheel>=0.34.2",]
build-backend = "setuptools.build_meta"
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
beautifulsoup4>=4.9.1
coincidence>=0.1.0
coverage>=5.1
coverage-pyver-pragma>=0.0.6
domdf-python-tools[testing]>=2.0.1
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ commands =
plugins = coverage_pyver_pragma

[coverage:report]
fail_under = 80
exclude_lines =
raise AssertionError
raise NotImplementedError
Expand All @@ -140,7 +141,6 @@ exclude_lines =
if TYPE_CHECKING:
if typing.TYPE_CHECKING:
if __name__ == .__main__.:
\.\.\.

[check-wheel-contents]
ignore = W002
Expand Down

0 comments on commit 177e9ca

Please sign in to comment.