Skip to content

Commit

Permalink
style: invalid Python versions (fixes #217)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Nov 2, 2020
1 parent 3331e76 commit 46cb2f9
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 44 deletions.
6 changes: 2 additions & 4 deletions Makefile
Expand Up @@ -32,10 +32,8 @@ clean-test: # Clean test output
.PHONY: .remove-old-cache

pre-commit .cache/make/long-pre-commit: .pre-commit-config.yaml .pre-commit-hooks.yaml # Update and install pre-commit hooks
@# Uncomment the lines below to autoupdate all repos except a few filtered out with egrep
# yq -r '.repos[].repo' .pre-commit-config.yaml | egrep -v -e '^local' -e mirrors-isort | \
# sed -E -e 's/http/--repo http/g' | xargs pre-commit autoupdate
pre-commit autoupdate
@# Uncomment the line below to autoupdate all repos except a few filtered out with egrep
yq -r '.repos[].repo' .pre-commit-config.yaml | egrep -v -e '^local' -e commitlint | sed -E -e 's/http/--repo http/g' | xargs pre-commit autoupdate
pre-commit install --install-hooks
pre-commit install --hook-type commit-msg
pre-commit gc
Expand Down
46 changes: 17 additions & 29 deletions docs/defaults.rst
Expand Up @@ -316,41 +316,17 @@ Content of `styles/pylint.toml <https://raw.githubusercontent.com/andreoliwa/nit
["pyproject.toml".tool.poetry.dev-dependencies]
pylint = "*"
.. _default-python-3-5-3-6-3-7-to-3-8:
.. _default-python-3-5:

Python 3.5, 3.6, 3.7 to 3.8
---------------------------

Content of `styles/python35-36-37-38.toml <https://raw.githubusercontent.com/andreoliwa/nitpick/develop/styles/python35-36-37-38.toml>`_:

.. code-block:: toml
["pyproject.toml".tool.poetry.dependencies]
python = "^3.5 || ^3.6 || ^3.7 || ^3.8"
.. _default-python-3-5-3-6-or-3-7:

Python 3.5, 3.6 or 3.7
----------------------

Content of `styles/python35-36-37.toml <https://raw.githubusercontent.com/andreoliwa/nitpick/develop/styles/python35-36-37.toml>`_:

.. code-block:: toml
["pyproject.toml".tool.poetry.dependencies]
python = "^3.5 || ^3.6 || ^3.7"
.. _default-python-3-6-or-3-7:

Python 3.6 or 3.7
-----------------
Python 3.5
----------

Content of `styles/python36-37.toml <https://raw.githubusercontent.com/andreoliwa/nitpick/develop/styles/python36-37.toml>`_:
Content of `styles/python35.toml <https://raw.githubusercontent.com/andreoliwa/nitpick/develop/styles/python35.toml>`_:

.. code-block:: toml
["pyproject.toml".tool.poetry.dependencies]
python = "^3.6 || ^3.7"
python = "^3.5"
.. _default-python-3-6:

Expand All @@ -375,3 +351,15 @@ Content of `styles/python37.toml <https://raw.githubusercontent.com/andreoliwa/n
["pyproject.toml".tool.poetry.dependencies]
python = "^3.7"
.. _default-python-3-8:

Python 3.8
----------

Content of `styles/python38.toml <https://raw.githubusercontent.com/andreoliwa/nitpick/develop/styles/python38.toml>`_:

.. code-block:: toml
["pyproject.toml".tool.poetry.dependencies]
python = "^3.8"
5 changes: 2 additions & 3 deletions docs/generate_rst.py
Expand Up @@ -35,11 +35,10 @@
"pre-commit/python.toml": "pre-commit_ (Python hooks)",
"pylint.toml": "Pylint_",
"pytest.toml": "pytest_",
"python35-36-37.toml": "Python 3.5, 3.6 or 3.7",
"python35-36-37-38.toml": "Python 3.5, 3.6, 3.7 to 3.8",
"python36-37.toml": "Python 3.6 or 3.7",
"python35.toml": "Python 3.5",
"python36.toml": "Python 3.6",
"python37.toml": "Python 3.7",
"python38.toml": "Python 3.8",
}
)
app = NitpickApp.create_app()
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
@@ -1,6 +1,6 @@
[tool.nitpick]
# Use the default style and override some things (like the Python version)
style = ["nitpick-style", "styles/python35-36-37-38"]
style = ["nitpick-style", "styles/python35"]

[tool.black]
line-length = 120
Expand Down Expand Up @@ -35,7 +35,7 @@ setup_cfg = "nitpick.plugins.setup_cfg"
pyproject_toml = "nitpick.plugins.pyproject_toml"

[tool.poetry.dependencies]
python = "^3.5 || ^3.6 || ^3.7 || ^3.8"
python = "^3.5"
flake8 = ">=3.0.0"
attrs = "*"
toml = "*"
Expand Down
2 changes: 0 additions & 2 deletions styles/python35-36-37-38.toml

This file was deleted.

2 changes: 1 addition & 1 deletion styles/python36-37.toml → styles/python35.toml
@@ -1,2 +1,2 @@
["pyproject.toml".tool.poetry.dependencies]
python = "^3.6 || ^3.7"
python = "^3.5"
2 changes: 1 addition & 1 deletion styles/python35-36-37.toml → styles/python38.toml
@@ -1,2 +1,2 @@
["pyproject.toml".tool.poetry.dependencies]
python = "^3.5 || ^3.6 || ^3.7"
python = "^3.8"

0 comments on commit 46cb2f9

Please sign in to comment.