summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/flake8/main/options.py11
-rw-r--r--src/flake8/processor.py3
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