Skip to content

Commit

Permalink
Updated files with 'repo_helper'.
Browse files Browse the repository at this point in the history
  • Loading branch information
repo-helper[bot] committed Jan 28, 2021
1 parent 772e08d commit 463089d
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 48 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"
37 changes: 0 additions & 37 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
55 changes: 55 additions & 0 deletions formate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[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 = [
"cftime",
"chemistry_tools",
"coincidence",
"coverage",
"coverage_pyver_pragma",
"docker",
"domdf_python_tools",
"github",
"importlib_resources",
"jinja2",
"numpy",
"pymassspec",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_rerunfailures",
"pytest_timeout",
"requests",
"sdjson",
]
known_first_party = "pyms_nist_search"
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 @@ -125,6 +125,7 @@ count = True
plugins = coverage_pyver_pragma
[coverage:report]
fail_under = 80
exclude_lines =
raise AssertionError
raise NotImplementedError
Expand All @@ -133,7 +134,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 463089d

Please sign in to comment.