Skip to content

Commit

Permalink
Updated files with 'repo_helper'. (#14)
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 18be128 commit 3be16c4
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 38 deletions.
28 changes: 0 additions & 28 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
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,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 Down
4 changes: 2 additions & 2 deletions doc-source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,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``:

.. prompt:: bash

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


Or, to run the complete autoformatting suite:
Expand Down
48 changes: 48 additions & 0 deletions formate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[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 = [
"coincidence",
"coverage",
"coverage_pyver_pragma",
"domdf_python_tools",
"github",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_timeout",
"requests",
"sphinx",
"sphinx_toolbox",
]
known_first_party = "sphinx_autofixture"
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"
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ count = True
plugins = coverage_pyver_pragma
[coverage:report]
fail_under = 80
exclude_lines =
raise AssertionError
raise NotImplementedError
Expand All @@ -154,7 +155,6 @@ exclude_lines =
if TYPE_CHECKING:
if typing.TYPE_CHECKING:
if __name__ == .__main__.:
:[\n\s]*\.\.\.
[check-wheel-contents]
ignore = W002
Expand Down

0 comments on commit 3be16c4

Please sign in to comment.