Skip to content

gaul/flake8-kw-only-args

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flake8-kw-only-args

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

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

Warnings

This plugin add new flake8 warning:

  • K801: non-kw-only argument

Requirements

  • Python 3.x (tested on 3.5, 3.6, and 3.7)
  • flake8 or pycodestyle

References

Licence

BSD license

About

Flake8 plugin that checks for default arguments that positional parameters can unintentionally override

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages