Skip to content

A flake8 extension that is looking for function calls and forces to use keyword arguments if there are more than X (default=2) arguments

License

Notifications You must be signed in to change notification settings

llybin/flake8-keyword-arguments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flake8-keyword-arguments


A flake8 extension that is looking for function calls and forces to use keyword arguments if there are more than X (default=2) arguments

Fork for python 2.7

Installation

pip install flake8-keyword-arguments

Example

def one_argument(one):
    pass


def two_arguments(one, two):
    pass


def multiple_arguments(one, two, three):
    pass


one_argument(1)
one_argument(one=1)
two_arguments(1, 2)
two_arguments(one=1, two=2)
multiple_arguments(one=1, two=2, three=3)
multiple_arguments(1, 2, 3)

Usage:

$ flake8 test.py
test.py:18: [FKA01] multiple_arguments's call uses 3 positional arguments, use keyword arguments.

$ flake8 test.py --max-pos-args=1
test.py:15: [FKA01] two_arguments's call uses 2 positional arguments, use keyword arguments.
test.py:18: [FKA01] multiple_arguments's call uses 3 positional arguments, use keyword arguments.

Tested on Python 2.7

Error codes

Error code Description
FKA01 XXX's call uses N positional arguments, use keyword arguments.

Options

Option Description
--max-pos_args How many positional arguments are allowed (default: 2)

About

A flake8 extension that is looking for function calls and forces to use keyword arguments if there are more than X (default=2) arguments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages