diff options
-rw-r--r-- | CONTRIBUTORS.txt | 2 | ||||
-rw-r--r-- | pylint/utils/utils.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index b46b2d0e8..0af205424 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -327,5 +327,7 @@ contributors: * Hugo van Kemenade: contributor +* Mikhail Fesenko: contributor + * Trevor Bekolay: contributor - Added --list-msgs-enabled command diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py index 5605ecd06..0bf4722c0 100644 --- a/pylint/utils/utils.py +++ b/pylint/utils/utils.py @@ -15,8 +15,10 @@ from astroid import Module, modutils from pylint.constants import PY_EXTS +DEFAULT_LINE_LENGTH = 79 -def normalize_text(text, line_len=80, indent=""): + +def normalize_text(text, line_len=DEFAULT_LINE_LENGTH, indent=""): """Wrap the text on the given line length.""" return "\n".join( textwrap.wrap( @@ -53,13 +55,13 @@ def get_rst_section(section, options, doc=None): if section: result += get_rst_title(section, "'") if doc: - formatted_doc = normalize_text(doc, line_len=79, indent="") + formatted_doc = normalize_text(doc) result += "%s\n\n" % formatted_doc for optname, optdict, value in options: help_opt = optdict.get("help") result += ":%s:\n" % optname if help_opt: - formatted_help = normalize_text(help_opt, line_len=79, indent=" ") + formatted_help = normalize_text(help_opt, indent=" ") result += "%s\n" % formatted_help if value: value = str(_format_option_value(optdict, value)) @@ -354,7 +356,7 @@ def _ini_format(stream, options): value = _format_option_value(optdict, value) help_opt = optdict.get("help") if help_opt: - help_opt = normalize_text(help_opt, line_len=79, indent="# ") + help_opt = normalize_text(help_opt, indent="# ") print(file=stream) print(help_opt, file=stream) else: |