Skip to content

Commit

Permalink
Updated files with 'repo_helper'. (#6)
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 463d7cd commit b5f95c3
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 45 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"
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
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
``flake2lint`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging, and `pre-commit <https://pre-commit.com>`_ to maintain code quality.
``flake2lint`` 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 @@ -4,7 +4,8 @@ Contributing

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

.. prompt:: 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:

.. prompt:: bash

Expand Down
49 changes: 49 additions & 0 deletions formate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[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 = [
"click",
"coincidence",
"consolekit",
"coverage",
"coverage_pyver_pragma",
"domdf_python_tools",
"flake8",
"github",
"pytest",
"pytest_cov",
"pytest_randomly",
"pytest_timeout",
"requests",
]
known_first_party = "flake2lint"
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,3 +1,4 @@
coincidence>=0.1.0
coverage>=5.1
coverage-pyver-pragma>=0.0.6
domdf-python-tools[testing]>=2.0.1
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ commands =

[flake8]
max-line-length = 120
select = E111 E112 E113 E121 E122 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E225 E226 E227 E228 E231 E241 E242 E251 E261 E262 E265 E271 E272 E301 E302 E303 E304 E305 E306 E402 E502 E703 E711 E712 E713 E714 E721 W291 W292 W293 W391 W504 YTT101 YTT102 YTT103 YTT201 YTT202 YTT203 YTT204 YTT301 YTT302 YTT303 STRFTIME001 STRFTIME002 SXL001 PT001 PT002 PT003 PT005 PT006 PT007 PT008 PT009 PT010 PT011 PT012 PT013 PT014 PT015 PT016 PT017 PT018 PT019 PT020 PT021 RST201 RST202 RST203 RST204 RST205 RST206 RST207 RST208 RST210 RST211 RST212 RST213 RST214 RST215 RST216 RST217 RST218 RST219 RST299 RST301 RST302 RST303 RST304 RST305 RST306 RST399 RST401 RST499 RST900 RST901 RST902 RST903 Q001 Q002 Q003 A001 A002 A003 TYP001 TYP002 TYP003 TYP004 TYP005 TYP006 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000
select = E111 E112 E113 E121 E122 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E225 E226 E227 E228 E231 E241 E242 E251 E261 E262 E265 E271 E272 E301 E303 E304 E305 E306 E402 E502 E703 E711 E712 E713 E714 E721 W291 W292 W293 W391 W504 YTT101 YTT102 YTT103 YTT201 YTT202 YTT203 YTT204 YTT301 YTT302 YTT303 STRFTIME001 STRFTIME002 SXL001 PT001 PT002 PT003 PT005 PT006 PT007 PT008 PT009 PT010 PT011 PT012 PT013 PT014 PT015 PT016 PT017 PT018 PT019 PT020 PT021 RST201 RST202 RST203 RST204 RST205 RST206 RST207 RST208 RST210 RST211 RST212 RST213 RST214 RST215 RST216 RST217 RST218 RST219 RST299 RST301 RST302 RST303 RST304 RST305 RST306 RST399 RST401 RST499 RST900 RST901 RST902 RST903 Q001 Q002 Q003 A001 A002 A003 TYP001 TYP002 TYP003 TYP004 TYP005 TYP006 Y001,Y002 Y003 Y004 Y005 Y006 Y007 Y008 Y009 Y010 Y011 Y012 Y013 Y014 Y015 Y090 Y091 E302 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000
exclude = doc-source,.git,__pycache__,old,build,dist,__pkginfo__.py,setup.py,.tox,venv
rst-directives =
TODO
envvar
extras-require
per-file-ignores =
tests/*: D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000
*/*.pyi: D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000
*/*.pyi: E302 D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000
pytest-parametrize-names-type = csv
inline-quotes = "
multiline-quotes = """
Expand All @@ -133,6 +133,7 @@ count = True
plugins = coverage_pyver_pragma
[coverage:report]
fail_under = 80
exclude_lines =
raise AssertionError
raise NotImplementedError
Expand All @@ -141,7 +142,6 @@ exclude_lines =
if TYPE_CHECKING:
if typing.TYPE_CHECKING:
if __name__ == .__main__.:
\.\.\.
[check-wheel-contents]
ignore = W002
Expand Down

0 comments on commit b5f95c3

Please sign in to comment.