summaryrefslogtreecommitdiff
path: root/doc/exts
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2022-05-23 21:09:25 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2022-05-24 08:52:32 +0200
commitcc8467e4680964bde94d4c8cfcf0de19ea42b61e (patch)
tree17384e9166db19ebf57a0e75e33698c9a8a0672c /doc/exts
parent84abb59aab47d1e5af549bdc51a0711084aeab27 (diff)
downloadpylint-git-cc8467e4680964bde94d4c8cfcf0de19ea42b61e.tar.gz
[doc] Remove trailing line feeds in generated RSTs
Diffstat (limited to 'doc/exts')
-rwxr-xr-xdoc/exts/pylint_extensions.py10
-rw-r--r--doc/exts/pylint_options.py3
2 files changed, 9 insertions, 4 deletions
diff --git a/doc/exts/pylint_extensions.py b/doc/exts/pylint_extensions.py
index fe80f7a51..8dec34a7d 100755
--- a/doc/exts/pylint_extensions.py
+++ b/doc/exts/pylint_extensions.py
@@ -74,10 +74,16 @@ def builder_inited(app: Optional[Sphinx]) -> None:
# Print checker documentation to stream
by_checker = get_plugins_info(linter, doc_files)
- for checker, information in sorted(by_checker.items()):
+ max_len = len(by_checker)
+ for i, checker_information in enumerate(sorted(by_checker.items())):
+ checker, information = checker_information
+ j = -1
checker = information["checker"]
del information["checker"]
- print(checker.get_full_documentation(**information)[:-1], file=stream)
+ if i == max_len - 1:
+ # Remove the \n\n at the end of the file
+ j = -3
+ print(checker.get_full_documentation(**information)[:j], file=stream)
def get_plugins_info(linter, doc_files):
diff --git a/doc/exts/pylint_options.py b/doc/exts/pylint_options.py
index 894f075fa..b044c2d34 100644
--- a/doc/exts/pylint_options.py
+++ b/doc/exts/pylint_options.py
@@ -156,8 +156,7 @@ def _write_options_page(options: OptionsDataDict, linter: PyLinter) -> None:
stream.write(
f"""
-{sections_string}
-"""
+{sections_string}"""
)