Skip to content

Commit 022aa8a

Browse files
committed
StyleGuide accepts optional keyword argument arglist
If given, arglist is passed on to process_options. This allows specifying a non-empty argument list when using pep8 as a library where command line arguments are not parsed.
1 parent dd06247 commit 022aa8a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pep8.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,11 +1571,12 @@ class StyleGuide(object):
15711571
def __init__(self, *args, **kwargs):
15721572
# build options from the command line
15731573
self.checker_class = kwargs.pop('checker_class', Checker)
1574+
arglist = kwargs.pop('arglist', None)
15741575
parse_argv = kwargs.pop('parse_argv', False)
15751576
config_file = kwargs.pop('config_file', None)
15761577
parser = kwargs.pop('parser', None)
15771578
options, self.paths = process_options(
1578-
parse_argv=parse_argv, config_file=config_file, parser=parser)
1579+
arglist, parse_argv, config_file, parser)
15791580
if args or kwargs:
15801581
# build options from dict
15811582
options_dict = dict(*args, **kwargs)

0 commit comments

Comments
 (0)