diff --git a/doc/user_guide/configuration/all-options.rst b/doc/user_guide/configuration/all-options.rst index 568cdde85c..e2662fc49f 100644 --- a/doc/user_guide/configuration/all-options.rst +++ b/doc/user_guide/configuration/all-options.rst @@ -904,9 +904,9 @@ Standard Checkers --indent-string """"""""""""""" -*String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).* +*String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1 tab).* -**Default:** `` `` +**Default:** ``" "`` --max-line-length diff --git a/doc/whatsnew/fragments/8392.other b/doc/whatsnew/fragments/8392.other new file mode 100644 index 0000000000..bdff1a1e5a --- /dev/null +++ b/doc/whatsnew/fragments/8392.other @@ -0,0 +1,4 @@ +Ensure the default value of 4 spaces for the `--indent-string` flag +does not compress when using reStructuredText to make docs. + +Closes #8392 diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index f8aecbda64..0ba1bce63e 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -219,11 +219,11 @@ class FormatChecker(BaseTokenChecker, BaseRawFileChecker): ( "indent-string", { - "default": " ", + "default": '" "', "type": "non_empty_string", "metavar": "", "help": "String used as indentation unit. This is usually " - '" " (4 spaces) or "\\t" (1 tab).', + '"    " (4 spaces) or "\\t" (1 tab).', # noqa: RUF001 }, ), (