mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 13:36:54 +00:00
Add indent-size option
This commit is contained in:
parent
e0fa9077ca
commit
d27df24240
3 changed files with 10 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ IGNORE = (
|
|||
)
|
||||
SELECT = ('E', 'F', 'W', 'C90')
|
||||
MAX_LINE_LENGTH = 79
|
||||
INDENT_SIZE = 4
|
||||
|
||||
TRUTHY_VALUES = set(['true', '1', 't'])
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ def register_default_options(option_manager):
|
|||
- ``--hang-closing``
|
||||
- ``--ignore``
|
||||
- ``--max-line-length``
|
||||
- ``--indent-size``
|
||||
- ``--select``
|
||||
- ``--disable-noqa``
|
||||
- ``--show-source``
|
||||
|
|
@ -115,6 +116,12 @@ def register_default_options(option_manager):
|
|||
'(Default: %default)',
|
||||
)
|
||||
|
||||
add_option(
|
||||
'--indent-size', type='int', metavar='n',
|
||||
default=defaults.INDENT_SIZE, parse_from_config=True,
|
||||
help='Number of spaces used for indentation (Default: %default)',
|
||||
)
|
||||
|
||||
add_option(
|
||||
'--select', metavar='errors', default=','.join(defaults.SELECT),
|
||||
parse_from_config=True, comma_separated_list=True,
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ class FileProcessor(object):
|
|||
self.indent_char = None
|
||||
#: Current level of indentation
|
||||
self.indent_level = 0
|
||||
#: Number of spaces used for indentation
|
||||
self.indent_size = options.indent_size
|
||||
#: Line number in the file
|
||||
self.line_number = 0
|
||||
#: Current logical line
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue