diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-01-23 07:59:09 -0800 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-01-29 08:58:10 -0800 |
| commit | 50e7cc71b99e49103177ae1fcd497abc696c114c (patch) | |
| tree | 7d7e904ca37e7204802c5b25e3adb09bcd16d342 /src | |
| parent | 532ea9ccab8a6271230d14b3f274e98bf829caba (diff) | |
| download | flake8-50e7cc71b99e49103177ae1fcd497abc696c114c.tar.gz | |
Latest pycodestyle
Diffstat (limited to 'src')
| -rw-r--r-- | src/flake8/main/options.py | 11 | ||||
| -rw-r--r-- | src/flake8/processor.py | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/flake8/main/options.py b/src/flake8/main/options.py index 666f42a..d2a7159 100644 --- a/src/flake8/main/options.py +++ b/src/flake8/main/options.py @@ -21,6 +21,7 @@ def register_default_options(option_manager): - ``--extend-ignore`` - ``--per-file-ignores`` - ``--max-line-length`` + - ``--max-doc-length`` - ``--select`` - ``--disable-noqa`` - ``--show-source`` @@ -165,6 +166,16 @@ def register_default_options(option_manager): ) add_option( + "--max-doc-length", + type="int", + metavar="n", + default=None, + parse_from_config=True, + help="Maximum allowed doc line length for the entirety of this run. " + "(Default: %default)", + ) + + add_option( "--select", metavar="errors", default=",".join(defaults.SELECT), diff --git a/src/flake8/processor.py b/src/flake8/processor.py index 47f5cd2..ece20b6 100644 --- a/src/flake8/processor.py +++ b/src/flake8/processor.py @@ -35,6 +35,7 @@ class FileProcessor(object): - :attr:`line_number` - :attr:`logical_line` - :attr:`max_line_length` + - :attr:`max_doc_length` - :attr:`multiline` - :attr:`noqa` - :attr:`previous_indent_level` @@ -80,6 +81,8 @@ class FileProcessor(object): self.logical_line = "" #: Maximum line length as configured by the user self.max_line_length = options.max_line_length + #: Maximum docstring / comment line length as configured by the user + self.max_doc_length = options.max_doc_length #: Whether the current physical line is multiline self.multiline = False #: Whether or not we're observing NoQA |
