Skip to content

Commit

Permalink
Merge branch 'develop' into leading-dash
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Nov 2, 2020
2 parents a3169d9 + 90d6a12 commit 79a5f43
Show file tree
Hide file tree
Showing 28 changed files with 377 additions and 438 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Expand Up @@ -3,13 +3,13 @@
# Thanks to https://github.com/sloria/environs/blob/master/.pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v3.3.0
hooks:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.7.3
hooks:
- id: pyupgrade
- repo: https://github.com/python/black
Expand All @@ -27,11 +27,11 @@ repos:
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.5.2
rev: v5.6.4
hooks:
- id: isort
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.6.0
rev: v1.7.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
Expand All @@ -48,14 +48,14 @@ repos:
types: [python]
always_run: true
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies: [flake8-blind-except, flake8-bugbear, flake8-comprehensions,
flake8-debugger, flake8-docstrings, flake8-isort, flake8-polyfill,
flake8-pytest, flake8-quotes, yesqa]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
rev: v0.790
hooks:
- id: mypy
# Using https://github.com/PyCQA/pylint doesn't work, it's a huge pain dealing with [MASTER]init-hook.
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
## [0.23.1](https://github.com/andreoliwa/nitpick/compare/v0.23.0...v0.23.1) (2020-11-02)


### Bug Fixes

* upgrade toml to 0.10.2 (fixes [#200](https://github.com/andreoliwa/nitpick/issues/200)) ([3331e76](https://github.com/andreoliwa/nitpick/commit/3331e7621ccece6c2fb04aa0f50b802fd0a3367c))

# [0.23.0](https://github.com/andreoliwa/nitpick/compare/v0.22.2...v0.23.0) (2020-09-18)


Expand Down
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
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -12,7 +12,7 @@
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=andreoliwa/nitpick)](https://dependabot.com)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Flake8 plugin to enforce the same tool configuration ([flake8](https://gitlab.com/pycqa/flake8), [isort](https://github.com/timothycrosley/isort), [mypy](http://mypy-lang.org/), [Pylint](https://www.pylint.org)...) across multiple Python projects.
Flake8 plugin to enforce the same tool configuration ([flake8](https://gitlab.com/pycqa/flake8), [isort](https://github.com/PyCQA/isort), [mypy](http://mypy-lang.org/), [Pylint](https://www.pylint.org)...) across multiple Python projects.

Useful if you maintain multiple projects and want to use the same configs in all of them.

Expand Down Expand Up @@ -44,8 +44,8 @@ combine_as_imports = true

This style will assert that:

- ... [black](https://github.com/psf/black), [isort](https://github.com/timothycrosley/isort) and [flake8](https://gitlab.com/pycqa/flake8) have a line length of 120;
- ... [flake8](https://gitlab.com/pycqa/flake8) and [isort](https://github.com/timothycrosley/isort) are configured as above in `setup.cfg`;
- ... [black](https://github.com/psf/black), [isort](https://github.com/PyCQA/isort) and [flake8](https://gitlab.com/pycqa/flake8) have a line length of 120;
- ... [flake8](https://gitlab.com/pycqa/flake8) and [isort](https://github.com/PyCQA/isort) are configured as above in `setup.cfg`;
- ... [Pylint](https://www.pylint.org) is present as a [Poetry](https://github.com/python-poetry/poetry) dev dependency in `pyproject.toml`).

## Quick setup
Expand All @@ -60,7 +60,7 @@ To try the package, simply install it (in a virtualenv or globally) and run `fla

$ flake8 .

Nitpick will download and use the opinionated [default style file](https://raw.githubusercontent.com/andreoliwa/nitpick/v0.23.0/nitpick-style.toml).
Nitpick will download and use the opinionated [default style file](https://raw.githubusercontent.com/andreoliwa/nitpick/v0.23.1/nitpick-style.toml).

You can use it as a template to configure your own style.

Expand All @@ -70,7 +70,7 @@ If you use [pre-commit](https://pre-commit.com/) on your project (you should), a

repos:
- repo: https://github.com/andreoliwa/nitpick
rev: v0.23.0
rev: v0.23.1
hooks:
- id: nitpick

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -18,7 +18,7 @@
author = "W. Augusto Andreoli"

# The short X.Y version
version = "0.23.0"
version = "0.23.1"
# The full version, including alpha/beta/rc tags
release = version

Expand Down
60 changes: 24 additions & 36 deletions docs/defaults.rst
Expand Up @@ -86,7 +86,7 @@ Content of `styles/flake8.toml <https://raw.githubusercontent.com/andreoliwa/nit
[["pre-commit-config.yaml".repos]]
yaml = """
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies: [flake8-blind-except, flake8-bugbear, flake8-comprehensions,
Expand Down Expand Up @@ -124,7 +124,7 @@ Content of `styles/isort.toml <https://raw.githubusercontent.com/andreoliwa/nitp
# The configuration below is needed for compatibility with black.
# https://github.com/python/black#how-black-wraps-lines
# https://github.com/timothycrosley/isort#multi-line-output-modes
# https://github.com/PyCQA/isort#multi-line-output-modes
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
Expand All @@ -137,7 +137,7 @@ Content of `styles/isort.toml <https://raw.githubusercontent.com/andreoliwa/nitp
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.5.2
rev: v5.6.4
hooks:
- id: isort
"""
Expand Down Expand Up @@ -171,7 +171,7 @@ Content of `styles/mypy.toml <https://raw.githubusercontent.com/andreoliwa/nitpi
[["pre-commit-config.yaml".repos]]
yaml = """
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
rev: v0.790
hooks:
- id: mypy
"""
Expand Down Expand Up @@ -257,13 +257,13 @@ Content of `styles/pre-commit/general.toml <https://raw.githubusercontent.com/an
[["pre-commit-config.yaml".repos]]
yaml = """
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v3.3.0
hooks:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.7.3
hooks:
- id: pyupgrade
"""
Expand Down Expand Up @@ -295,7 +295,7 @@ Content of `styles/pre-commit/python.toml <https://raw.githubusercontent.com/and
[["pre-commit-config.yaml".repos]]
yaml = """
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.6.0
rev: v1.7.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-mock-methods
Expand All @@ -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
2 changes: 1 addition & 1 deletion docs/installation_guide.rst
Expand Up @@ -35,7 +35,7 @@ If you use pre-commit_ on your project (you should), add this to the ``.pre-comm
repos:
- repo: https://github.com/andreoliwa/nitpick
rev: v0.23.0
rev: v0.23.1
hooks:
- id: nitpick
Expand Down
6 changes: 3 additions & 3 deletions docs/targets.rst
@@ -1,11 +1,11 @@
.. _nitpick-style.toml:
.. _default style file: https://raw.githubusercontent.com/andreoliwa/nitpick/v0.23.0/nitpick-style.toml
.. _default style file: https://raw.githubusercontent.com/andreoliwa/nitpick/v0.23.1/nitpick-style.toml

.. _black: https://github.com/psf/black
.. _Django: https://www.djangoproject.com
.. _flake8: https://gitlab.com/pycqa/flake8/
.. _Flask CLI: http://flask.palletsprojects.com/en/1.1.x/cli/
.. _isort: https://github.com/timothycrosley/isort/
.. _Flask CLI: https://flask.palletsprojects.com/en/1.1.x/cli/
.. _isort: https://github.com/PyCQA/isort/
.. _mypy: https://github.com/python/mypy/
.. _Nitpick: https://github.com/andreoliwa/nitpick/
.. _Pipenv: https://github.com/pypa/pipenv/
Expand Down
2 changes: 1 addition & 1 deletion nitpick-style.toml
@@ -1,5 +1,5 @@
# Default style file for nitpick
# https://raw.githubusercontent.com/andreoliwa/nitpick/v0.23.0/nitpick-style.toml
# https://raw.githubusercontent.com/andreoliwa/nitpick/v0.23.1/nitpick-style.toml

[nitpick]
minimum_version = "0.10.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "nitpick",
"version": "0.23.0",
"version": "0.23.1",
"repository": {
"type": "git",
"url": "https://github.com/andreoliwa/nitpick.git"
Expand Down

0 comments on commit 79a5f43

Please sign in to comment.