Skip to content

Commit

Permalink
Bump version: 0.9.0 → 0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Mar 11, 2019
1 parent e8fe15c commit 5329903
Show file tree
Hide file tree
Showing 20 changed files with 157 additions and 123 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<a name="0.10.0"></a>
# [0.10.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.9.0...v0.10.0) (2019-03-11)


### Features

* assume style has a .toml extension when it's missing ([5a584ac](https://github.com/andreoliwa/flake8-nitpick/commit/5a584ac))
* read local style files from relative and other root dirs ([82d3675](https://github.com/andreoliwa/flake8-nitpick/commit/82d3675))
* read relative styles in subdirectories of a symlink dir ([55634e1](https://github.com/andreoliwa/flake8-nitpick/commit/55634e1))
* read styles from relative paths on URLs ([46d1b84](https://github.com/andreoliwa/flake8-nitpick/commit/46d1b84))



<a name="0.9.0"></a>
# [0.9.0](https://github.com/andreoliwa/flake8-nitpick/compare/v0.8.1...v0.9.0) (2019-03-06)

Expand Down
2 changes: 1 addition & 1 deletion flake8_nitpick/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Main module."""

__version__ = "0.9.0"
__version__ = "0.10.0"
131 changes: 14 additions & 117 deletions nitpick-style.toml
Original file line number Diff line number Diff line change
@@ -1,123 +1,20 @@
# Default style file for flake8-nitpick
# https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/master/nitpick-style.toml

[nitpick.files.absent]
"requirements.txt" = "Install poetry, run 'poetry init' to create pyproject.toml, and move dependencies to it"
".isort.cfg" = "Move values to setup.cfg, section [isort]"
"Pipfile" = "Use pyproject.toml instead"
"Pipfile.lock" = "Use pyproject.toml instead"
".venv" = ""
".pyup.yml" = "Configure .travis.yml with safety instead: https://github.com/pyupio/safety#using-safety-with-a-ci-service"

[nitpick.files."pyproject.toml"]
missing_message = "Install poetry and run 'poetry init' to create it"

["pyproject.toml".tool.black]
line-length = 120

["pyproject.toml".tool.poetry.dependencies]
python = "^3.6 || ^3.7"

["pyproject.toml".tool.poetry.dev-dependencies]
black = {version = "*", allows-prereleases = true}
flake8-blind-except = "*"
flake8-bugbear = "*"
flake8-comprehensions = "*"
flake8-debugger = "*"
flake8-docstrings = "*"
flake8-isort = "*"
flake8-mypy = "*"
flake8-polyfill = "*"
flake8-pytest = "*"
flake8-quotes = "*"
pre-commit = {version = "*", allows-prereleases = true}

ipython = "*"
ipdb = "*"
pylint = "*"
mypy = "*"
[nitpick.styles]
include = [
"styles/python36-37",
"styles/poetry",
"styles/absent-files",
"styles/black",
"styles/flake8",
"styles/pylint",
"styles/isort",
"styles/mypy",
"styles/pre-commit",
"styles/pytest",
"styles/ipython",
]

[nitpick.files."setup.cfg"]
comma_separated_values = ["flake8.ignore", "flake8.exclude", "isort.skip", "isort.known_first_party"]

["setup.cfg".flake8]
# http://www.pydocstyle.org/en/2.1.1/error_codes.html
# Ignoring W503: https://github.com/ambv/black#line-breaks--binary-operators
# Ignoring "D202 No blank lines allowed after function docstring": black inserts a blank line.
ignore = "D107,D202,D203,D401,E203,E402,E501,W503"
max-line-length = 120
inline-quotes = "double"
exclude = ".tox,build"

["setup.cfg".isort]
line_length = 120
skip = ".tox,build"
known_first_party = "tests"

# The configuration below is needed for compatibility with black.
# https://github.com/ambv/black#how-black-wraps-lines
# https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true

# https://mypy.readthedocs.io/en/latest/config_file.html
["setup.cfg".mypy]
ignore_missing_imports = true

# Do not follow imports (except for ones found in typeshed)
follow_imports = "skip"

# Treat Optional per PEP 484
strict_optional = true

# Ensure all execution paths are returning
warn_no_return = true

# Lint-style cleanliness for typing
warn_redundant_casts = true
warn_unused_ignores = true

[nitpick.files."pre-commit-config.yaml"]
missing_message = "Create the file with the contents below, then run 'pre-commit install'"

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
["pre-commit-config.yaml"]
fail_fast = true

[["pre-commit-config.yaml".repos]]
repo = "local"
hooks = """
- id: isort
name: isort
entry: isort -sp setup.cfg
language: system
language_version: python
types: [python]
- id: black
name: black
entry: black
language: system
language_version: python
types: [python]
- id: mypy
name: mypy
# For now this should always ignore the exit code and I could not find a way to ignore if a hook fail on the docs
entry: python -c 'import sys; import subprocess;
subprocess.run(["mypy", "--ignore-missing-imports"] + sys.argv[1:])'
language: system
language_version: python
verbose: True
types: [python]
- id: flake8
name: flake8
entry: flake8
language: system
language_version: python
types: [python]
"""
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flake8-nitpick",
"version": "0.9.0",
"version": "0.10.0",
"repository": {
"type": "git",
"url": "https://github.com/andreoliwa/flake8-nitpick.git"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ line-length = 120

[tool.poetry]
name = "flake8-nitpick"
version = "0.9.0"
version = "0.10.0"
description = "Flake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects"
authors = ["W. Augusto Andreoli <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.0
current_version = 0.10.0
commit = False
tag = False

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

setup_kwargs = {
"name": "flake8-nitpick",
"version": "0.9.0",
"version": "0.10.0",
"description": "Flake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects",
"long_description": '# flake8-nitpick\n\n[![PyPI](https://img.shields.io/pypi/v/flake8-nitpick.svg)](https://pypi.python.org/pypi/flake8-nitpick)\n[![Travis CI](https://travis-ci.com/andreoliwa/flake8-nitpick.svg?branch=master)](https://travis-ci.com/andreoliwa/flake8-nitpick)\n[![Coveralls](https://coveralls.io/repos/github/andreoliwa/flake8-nitpick/badge.svg?branch=master)](https://coveralls.io/github/andreoliwa/flake8-nitpick?branch=master)\n[![Maintainability](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/maintainability)](https://codeclimate.com/github/andreoliwa/flake8-nitpick/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/test_coverage)](https://codeclimate.com/github/andreoliwa/flake8-nitpick/test_coverage)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nFlake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects.\n\nA "nitpick code style" is a [TOML](https://github.com/toml-lang/toml) file with settings that should be present in config files from other tools. E.g.:\n\n- `pyproject.toml` and `setup.cfg` (used by [flake8](http://flake8.pycqa.org/), [black](https://black.readthedocs.io/), [isort](https://isort.readthedocs.io/), [mypy](https://mypy.readthedocs.io/));\n- `.pylintrc` (used by [pylint](https://pylint.readthedocs.io/) config);\n- more files to come.\n\n---\n\n- [Installation and usage](#installation-and-usage)\n- [Style file](#style-file)\n- [setup.cfg](#setupcfg)\n\n---\n\n## Installation and usage\n\nSimply install the package (in a virtualenv or globally, wherever) and run `flake8`:\n\n $ pip install -U flake8-nitpick\n $ flake8\n\nYou will see warnings if your project configuration is different than [the default style file](https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/master/nitpick-style.toml).\n\n## Style file\n\n### Configure your own style file\n\nChange your project config on `pyproject.toml`, and configure your own style like this:\n\n [tool.nitpick]\n style = "https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/master/nitpick-style.toml"\n\nYou can set `style` with any local file or URL. E.g.: you can use the raw URL of a [GitHub Gist](https://gist.github.com).\n\nYou can also use multiple styles and mix local files and URLs:\n\n [tool.nitpick]\n style = ["/path/to/first.toml", "/another/path/to/second.toml", "https://example.com/on/the/web/third.toml"]\n\nThe order is important: each style will override any keys that might be set by the previous .toml file.\nIf a key is defined in more than one file, the value from the last file will prevail. \n\n### Default search order for a style file\n\n1. A file or URL configured in the `pyproject.toml` file, `[tool.nitpick]` section, `style` key, as [described above](#configure-your-own-style-file).\n\n2. Any `nitpick-style.toml` file found in the current directory (the one in which `flake8` runs from) or above.\n\n3. If no style is found, then [the default style file from GitHub](https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/master/nitpick-style.toml) is used.\n\n### Style file syntax\n\nA style file contains basically the configuration options you want to enforce in all your projects.\n\nThey are just the config to the tool, prefixed with the name of the config file.\n\nE.g.: To [configure the black formatter](https://github.com/ambv/black#configuration-format) with a line length of 120, you use this in your `pyproject.toml`:\n\n [tool.black]\n line-length = 120\n\nTo enforce that all your projects use this same line length, add this to your `nitpick-style.toml` file:\n\n ["pyproject.toml".tool.black]\n line-length = 120\n\nIt\'s the same exact section/key, just prefixed with the config file name (`"pyproject.toml".`)\n\nThe same works for `setup.cfg`.\nTo [configure mypy](https://mypy.readthedocs.io/en/latest/config_file.html#config-file-format) to ignore missing imports in your project:\n\n [mypy]\n ignore_missing_imports = true\n\nTo enforce all your projects to ignore missing imports, add this to your `nitpick-style.toml` file:\n\n ["setup.cfg".mypy]\n ignore_missing_imports = true\n\n### Absent files\n\nTo enforce that certain files should not exist in the project, you can add them to the style file.\n\n [[files.absent]]\n file = "myfile1.txt"\n\n [[files.absent]]\n file = "another_file.env"\n message = "This is an optional extra string to display after the warning"\n\nMultiple files can be configured as above.\nThe `message` is optional.\n\n## setup.cfg\n\n### Comma separated values\n\nOn `setup.cfg`, some keys are lists of multiple values separated by commas, like `flake8.ignore`.\n\nOn the style file, it\'s possible to indicate which key/value pairs should be treated as multiple values instead of an exact string.\nMultiple keys can be added.\n\n ["setup.cfg".nitpick]\n comma_separated_values = ["flake8.ignore", "isort.some_key", "another_section.another_key"]\n',
"long_description": '# flake8-nitpick\n\n[![PyPI](https://img.shields.io/pypi/v/flake8-nitpick.svg)](https://pypi.python.org/pypi/flake8-nitpick)\n[![Travis CI](https://travis-ci.com/andreoliwa/flake8-nitpick.svg?branch=master)](https://travis-ci.com/andreoliwa/flake8-nitpick)\n[![Coveralls](https://coveralls.io/repos/github/andreoliwa/flake8-nitpick/badge.svg?branch=master)](https://coveralls.io/github/andreoliwa/flake8-nitpick?branch=master)\n[![Maintainability](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/maintainability)](https://codeclimate.com/github/andreoliwa/flake8-nitpick/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/901b4b62293cf7f2c4bc/test_coverage)](https://codeclimate.com/github/andreoliwa/flake8-nitpick/test_coverage)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/flake8-nitpick.svg)](https://pypi.org/project/flake8-nitpick/)\n[![Project License](https://img.shields.io/pypi/l/flake8-nitpick.svg)](https://pypi.org/project/flake8-nitpick/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nFlake8 plugin to enforce the same lint configuration (flake8, isort, mypy, pylint) across multiple Python projects.\n\nA "nitpick code style" is a [TOML](https://github.com/toml-lang/toml) file with settings that should be present in config files from other tools. E.g.:\n\n- `pyproject.toml` and `setup.cfg` (used by [flake8](http://flake8.pycqa.org/), [black](https://black.readthedocs.io/), [isort](https://isort.readthedocs.io/), [mypy](https://mypy.readthedocs.io/));\n- `.pylintrc` (used by [pylint](https://pylint.readthedocs.io/) config);\n- more files to come.\n\n---\n\n- [Installation and usage](#installation-and-usage)\n- [Style file](#style-file)\n- [setup.cfg](#setupcfg)\n\n---\n\n## Installation and usage\n\nSimply install the package (in a virtualenv or globally, wherever) and run `flake8`:\n\n $ pip install -U flake8-nitpick\n $ flake8\n\nYou will see warnings if your project configuration is different than [the default style file](https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/master/nitpick-style.toml).\n\n## Style file\n\n### Configure your own style file\n\nChange your project config on `pyproject.toml`, and configure your own style like this:\n\n [tool.nitpick]\n style = "https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/master/nitpick-style.toml"\n\nYou can set `style` with any local file or URL. E.g.: you can use the raw URL of a [GitHub Gist](https://gist.github.com).\n\nYou can also use multiple styles and mix local files and URLs:\n\n [tool.nitpick]\n style = ["/path/to/first.toml", "/another/path/to/second.toml", "https://example.com/on/the/web/third.toml"]\n\nThe order is important: each style will override any keys that might be set by the previous .toml file.\nIf a key is defined in more than one file, the value from the last file will prevail. \n\n### Default search order for a style file\n\n1. A file or URL configured in the `pyproject.toml` file, `[tool.nitpick]` section, `style` key, as [described above](#configure-your-own-style-file).\n\n2. Any `nitpick-style.toml` file found in the current directory (the one in which `flake8` runs from) or above.\n\n3. If no style is found, then [the default style file from GitHub](https://raw.githubusercontent.com/andreoliwa/flake8-nitpick/master/nitpick-style.toml) is used.\n\n### Style file syntax\n\nA style file contains basically the configuration options you want to enforce in all your projects.\n\nThey are just the config to the tool, prefixed with the name of the config file.\n\nE.g.: To [configure the black formatter](https://github.com/ambv/black#configuration-format) with a line length of 120, you use this in your `pyproject.toml`:\n\n [tool.black]\n line-length = 120\n\nTo enforce that all your projects use this same line length, add this to your `nitpick-style.toml` file:\n\n ["pyproject.toml".tool.black]\n line-length = 120\n\nIt\'s the same exact section/key, just prefixed with the config file name (`"pyproject.toml".`)\n\nThe same works for `setup.cfg`.\nTo [configure mypy](https://mypy.readthedocs.io/en/latest/config_file.html#config-file-format) to ignore missing imports in your project:\n\n [mypy]\n ignore_missing_imports = true\n\nTo enforce all your projects to ignore missing imports, add this to your `nitpick-style.toml` file:\n\n ["setup.cfg".mypy]\n ignore_missing_imports = true\n\n### Absent files\n\nTo enforce that certain files should not exist in the project, you can add them to the style file.\n\n [[files.absent]]\n file = "myfile1.txt"\n\n [[files.absent]]\n file = "another_file.env"\n message = "This is an optional extra string to display after the warning"\n\nMultiple files can be configured as above.\nThe `message` is optional.\n\n## setup.cfg\n\n### Comma separated values\n\nOn `setup.cfg`, some keys are lists of multiple values separated by commas, like `flake8.ignore`.\n\nOn the style file, it\'s possible to indicate which key/value pairs should be treated as multiple values instead of an exact string.\nMultiple keys can be added.\n\n ["setup.cfg".nitpick]\n comma_separated_values = ["flake8.ignore", "isort.some_key", "another_section.another_key"]\n',
"author": "W. Augusto Andreoli",
"author_email": "[email protected]",
"url": "https://github.com/andreoliwa/flake8-nitpick",
Expand Down
7 changes: 7 additions & 0 deletions styles/absent-files.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[nitpick.files.absent]
"requirements.txt" = "Install poetry, run 'poetry init' to create pyproject.toml, and move dependencies to it"
".isort.cfg" = "Move values to setup.cfg, section [isort]"
"Pipfile" = "Use pyproject.toml instead"
"Pipfile.lock" = "Use pyproject.toml instead"
".venv" = ""
".pyup.yml" = "Configure .travis.yml with safety instead: https://github.com/pyupio/safety#using-safety-with-a-ci-service"
5 changes: 5 additions & 0 deletions styles/black.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
["pyproject.toml".tool.black]
line-length = 120

["pyproject.toml".tool.poetry.dev-dependencies]
black = {version = "*", allows-prereleases = true}
17 changes: 17 additions & 0 deletions styles/flake8.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
["pyproject.toml".tool.poetry.dev-dependencies]
flake8-blind-except = "*"
flake8-bugbear = "*"
flake8-comprehensions = "*"
flake8-debugger = "*"
flake8-docstrings = "*"
flake8-polyfill = "*"
flake8-quotes = "*"

["setup.cfg".flake8]
# http://www.pydocstyle.org/en/2.1.1/error_codes.html
# Ignoring W503: https://github.com/ambv/black#line-breaks--binary-operators
# Ignoring "D202 No blank lines allowed after function docstring": black inserts a blank line.
ignore = "D107,D202,D203,D401,E203,E402,E501,W503"
max-line-length = 120
inline-quotes = "double"
exclude = ".tox,build"
3 changes: 3 additions & 0 deletions styles/ipython.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
["pyproject.toml".tool.poetry.dev-dependencies]
ipython = "*"
ipdb = "*"
15 changes: 15 additions & 0 deletions styles/isort.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
["pyproject.toml".tool.poetry.dev-dependencies]
flake8-isort = "*"

["setup.cfg".isort]
line_length = 120
skip = ".tox,build"
known_first_party = "tests"

# The configuration below is needed for compatibility with black.
# https://github.com/ambv/black#how-black-wraps-lines
# https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
20 changes: 20 additions & 0 deletions styles/mypy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
["pyproject.toml".tool.poetry.dev-dependencies]
mypy = "*"
flake8-mypy = "*"

# https://mypy.readthedocs.io/en/latest/config_file.html
["setup.cfg".mypy]
ignore_missing_imports = true

# Do not follow imports (except for ones found in typeshed)
follow_imports = "skip"

# Treat Optional per PEP 484
strict_optional = true

# Ensure all execution paths are returning
warn_no_return = true

# Lint-style cleanliness for typing
warn_redundant_casts = true
warn_unused_ignores = true
2 changes: 2 additions & 0 deletions styles/poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[nitpick.files."pyproject.toml"]
missing_message = "Install poetry and run 'poetry init' to create it"
45 changes: 45 additions & 0 deletions styles/pre-commit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[nitpick.files."pre-commit-config.yaml"]
missing_message = "Create the file with the contents below, then run 'pre-commit install'"

["pyproject.toml".tool.poetry.dev-dependencies]
pre-commit = {version = "*", allows-prereleases = true}

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
["pre-commit-config.yaml"]
fail_fast = true

[["pre-commit-config.yaml".repos]]
repo = "local"
hooks = """
- id: isort
name: isort
entry: isort -sp setup.cfg
language: system
language_version: python
types: [python]
- id: black
name: black
entry: black
language: system
language_version: python
types: [python]
- id: mypy
name: mypy
# For now this should always ignore the exit code and I could not find a way to ignore if a hook fail on the docs
entry: python -c 'import sys; import subprocess;
subprocess.run(["mypy", "--ignore-missing-imports"] + sys.argv[1:])'
language: system
language_version: python
verbose: True
types: [python]
- id: flake8
name: flake8
entry: flake8
language: system
language_version: python
types: [python]
"""
2 changes: 2 additions & 0 deletions styles/pylint.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
["pyproject.toml".tool.poetry.dev-dependencies]
pylint = "*"
2 changes: 2 additions & 0 deletions styles/pytest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
["pyproject.toml".tool.poetry.dev-dependencies]
flake8-pytest = "*"
2 changes: 2 additions & 0 deletions styles/python36-37.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
["pyproject.toml".tool.poetry.dependencies]
python = "^3.6 || ^3.7"
2 changes: 2 additions & 0 deletions styles/python36.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
["pyproject.toml".tool.poetry.dependencies]
python = "^3.6"
2 changes: 2 additions & 0 deletions styles/python37.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
["pyproject.toml".tool.poetry.dependencies]
python = "^3.7"

0 comments on commit 5329903

Please sign in to comment.