A flake8 plugin that checks for default arguments like:
def default(key=value):
...
Positional parameters can unintentionally override these arguments. Instead use the safer kw-only argument equivalent:
def kw_only(*, key=value):
...
Install with pip
:
$ pip install flake8-kw-only-args
You can check that flake8
has picked it up by looking for flake8-kw-only-args
in the output of --version
:
$ flake8 --version
2.6.2 (pycodestyle: 2.0.0, flake8-kw-only-args: 1.0.0, pyflakes: 1.2.3, mccabe: 0.5.0) CPython 2.7.11+ on Linux
This plugin add new flake8 warning:
K801
: non-kw-only argument
- Python 3.x (tested on 3.5, 3.6, and 3.7)
- flake8 or pycodestyle
BSD license