Skip to content

Commit 5b10ff1

Browse files
committed
pylint: Enable and fix singleton-comparison warnings
1 parent 784ae91 commit 5b10ff1

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def setup(sphinx):
7373
with open('../CMakeLists.txt', 'r', encoding='utf8') as f:
7474
version = re.search('PROJECT_VERSION "([^"]+)"', f.read()).group(1)
7575
# The full version, including alpha/beta/rc tags.
76-
if os.path.isfile('../prerelease.txt') != True or os.path.getsize('../prerelease.txt') == 0:
76+
if not os.path.isfile('../prerelease.txt') or os.path.getsize('../prerelease.txt') == 0:
7777
release = version
7878
else:
7979
# This is a prerelease version

scripts/error_codes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def read_file(file_name):
1818
with open(file_name, "r", encoding="latin-1" if is_latin else ENCODING) as f:
1919
content = f.read()
2020
finally:
21-
if content == None:
21+
if content is None:
2222
print(f"Error reading: {file_name}")
2323
return content
2424

scripts/pylintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ disable=
2727
pointless-string-statement,
2828
redefined-builtin,
2929
redefined-outer-name,
30-
singleton-comparison,
3130
too-few-public-methods,
3231
too-many-public-methods,
3332
ungrouped-imports

scripts/splitSources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def writeSourceToFile(lines):
4040
filePath, srcName = extractSourceName(lines[0])
4141
# print("sourceName is ", srcName)
4242
# print("filePath is", filePath)
43-
if filePath != False:
43+
if filePath:
4444
os.system("mkdir -p " + filePath)
4545
with open(srcName, mode='a+', encoding='utf8', newline='') as f:
4646
createdSources.append(srcName)

test/lsp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def receive_message(self) -> Union[None, dict]:
5050
# Note, we should make use of timeout to avoid infinite blocking if nothing is received.
5151
CONTENT_LENGTH_HEADER = "Content-Length: "
5252
CONTENT_TYPE_HEADER = "Content-Type: "
53-
if self.process.stdout == None:
53+
if self.process.stdout is None:
5454
return None
5555
message_size = None
5656
while True:
@@ -84,7 +84,7 @@ def receive_message(self) -> Union[None, dict]:
8484
return json_object
8585

8686
def send_message(self, method_name: str, params: Optional[dict]) -> None:
87-
if self.process.stdin == None:
87+
if self.process.stdin is None:
8888
return
8989
message = {
9090
'jsonrpc': '2.0',
@@ -246,7 +246,7 @@ def setup_lsp(self, lsp: JsonRpcProcess, expose_project_root=True):
246246
}
247247
}
248248
}
249-
if expose_project_root == False:
249+
if not expose_project_root:
250250
params['rootUri'] = None
251251
lsp.call_method('initialize', params)
252252
lsp.send_notification('initialized')

0 commit comments

Comments
 (0)