From bb67647d46a14d281c2547150df7d3e62fb361f8 Mon Sep 17 00:00:00 2001 From: Roger Sheu Date: Sat, 31 Aug 2024 22:44:08 -0700 Subject: [PATCH 1/5] change spaces to U+2002 --- doc/user_guide/configuration/all-options.rst | 4 ++-- pylint/checkers/format.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/user_guide/configuration/all-options.rst b/doc/user_guide/configuration/all-options.rst index 568cdde85c..c0105f87d0 100644 --- a/doc/user_guide/configuration/all-options.rst +++ b/doc/user_guide/configuration/all-options.rst @@ -906,7 +906,7 @@ Standard Checkers """"""""""""""" *String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).* -**Default:** `` `` +**Default:** ``    `` --max-line-length @@ -955,7 +955,7 @@ Standard Checkers indent-after-paren = 4 - indent-string = " " + indent-string = "    " max-line-length = 100 diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index f8aecbda64..04568e611d 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -219,7 +219,7 @@ class FormatChecker(BaseTokenChecker, BaseRawFileChecker): ( "indent-string", { - "default": " ", + "default": "    ", "type": "non_empty_string", "metavar": "", "help": "String used as indentation unit. This is usually " From e608a28320b155fe5913d8a5d70332a3fccc1f35 Mon Sep 17 00:00:00 2001 From: Roger Sheu Date: Sat, 31 Aug 2024 22:44:08 -0700 Subject: [PATCH 2/5] change spaces to U+2002 --- doc/user_guide/configuration/all-options.rst | 4 ++-- pylint/checkers/format.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/user_guide/configuration/all-options.rst b/doc/user_guide/configuration/all-options.rst index c0105f87d0..a1cd5d08ef 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/pylint/checkers/format.py b/pylint/checkers/format.py index 04568e611d..abbc285699 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).', }, ), ( From fbfd9e48eaafbb0b0961535056e1986981f3d95c Mon Sep 17 00:00:00 2001 From: Roger Sheu Date: Sat, 31 Aug 2024 23:07:49 -0700 Subject: [PATCH 3/5] add change to changelog --- doc/whatsnew/fragments/8392.other | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/whatsnew/fragments/8392.other 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 From 67cd28ae16323e2ac7afa8c5267b505457996c93 Mon Sep 17 00:00:00 2001 From: Roger Sheu Date: Sat, 31 Aug 2024 23:26:01 -0700 Subject: [PATCH 4/5] changed the default back to spaces (with "") --- doc/user_guide/configuration/all-options.rst | 4 ++-- pylint/checkers/format.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/user_guide/configuration/all-options.rst b/doc/user_guide/configuration/all-options.rst index a1cd5d08ef..e2662fc49f 100644 --- a/doc/user_guide/configuration/all-options.rst +++ b/doc/user_guide/configuration/all-options.rst @@ -906,7 +906,7 @@ Standard Checkers """"""""""""""" *String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1 tab).* -**Default:** ``"    "`` +**Default:** ``" "`` --max-line-length @@ -955,7 +955,7 @@ Standard Checkers indent-after-paren = 4 - indent-string = "    " + indent-string = " " max-line-length = 100 diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index abbc285699..9b757fc739 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -219,7 +219,7 @@ class FormatChecker(BaseTokenChecker, BaseRawFileChecker): ( "indent-string", { - "default": '"    "', + "default": '" "', "type": "non_empty_string", "metavar": "", "help": "String used as indentation unit. This is usually " From 0e68059052e3bbf9ed14bce9876deb630e422e13 Mon Sep 17 00:00:00 2001 From: Roger Sheu Date: Sat, 31 Aug 2024 23:26:01 -0700 Subject: [PATCH 5/5] changed the default back to spaces (with "") --- pylint/checkers/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index 9b757fc739..0ba1bce63e 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -223,7 +223,7 @@ class FormatChecker(BaseTokenChecker, BaseRawFileChecker): "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 }, ), (