summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2022-11-07 17:19:52 +0100
committerGitHub <noreply@github.com>2022-11-07 17:19:52 +0100
commita04f641c9d9d95c232db81aa4649a00e7e7e87e1 (patch)
treeb3c42bc1f59b2d6cc8e6260aead993bee8d13423 /script
parentf262c43bc430d7146d0cc9a9bd968fc89981e01e (diff)
downloadpylint-git-a04f641c9d9d95c232db81aa4649a00e7e7e87e1.tar.gz
[use-implicit-booleaness] Fix comparison to empty strings across the codebase (#7722)
As it will become a default check in #6870 it will be easier to review it if we separate the two
Diffstat (limited to 'script')
-rw-r--r--script/fix_documentation.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/script/fix_documentation.py b/script/fix_documentation.py
index 1c97459c8..e8def2f73 100644
--- a/script/fix_documentation.py
+++ b/script/fix_documentation.py
@@ -36,12 +36,7 @@ def changelog_insert_empty_lines(file_content: str, subtitle_text: str) -> str:
for i, line in enumerate(lines):
if line.startswith(subtitle_text):
subtitle_count += 1
- if (
- subtitle_count == 1
- or i < 2
- or lines[i - 1] == ""
- and lines[i - 2] == ""
- ):
+ if subtitle_count == 1 or i < 2 or not lines[i - 1] and not lines[i - 2]:
continue
lines.insert(i, "")
return "\n".join(lines)