Skip to content

Commit 0e6e666

Browse files
committed
Fix existing code
1 parent 4728812 commit 0e6e666

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

pylint/checkers/classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ def _check_unused_private_attributes(self, node: astroid.ClassDef) -> None:
981981
(
982982
# If assigned to cls.attrib, can be accessed by cls/self
983983
assign_attr.expr.name == "cls"
984-
and attribute.expr.name in ["cls", "self"]
984+
and attribute.expr.name in ("cls", "self")
985985
)
986986
# If assigned to self.attrib, can only be accessed by self
987987
# Or if __new__ was used, the returned object names are acceptable

pylint/checkers/python3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _in_iterating_context(node):
156156
elif (
157157
isinstance(parent, astroid.Compare)
158158
and len(parent.ops) == 1
159-
and parent.ops[0][0] in ["in", "not in"]
159+
and parent.ops[0][0] in ("in", "not in")
160160
):
161161
return True
162162
# Also if it's an `yield from`, that's fair

pylint/checkers/refactoring/refactoring_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ def _check_consider_using_generator(self, node):
943943
# remove square brackets '[]'
944944
inside_comp = node.args[0].as_string()[1:-1]
945945
call_name = node.func.name
946-
if call_name in ["any", "all"]:
946+
if call_name in ("any", "all"):
947947
self.add_message(
948948
"use-a-generator",
949949
node=node,

pylint/checkers/stdlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def _check_redundant_assert(self, node, infer):
558558
isinstance(infer, astroid.BoundMethod)
559559
and node.args
560560
and isinstance(node.args[0], astroid.Const)
561-
and infer.name in ["assertTrue", "assertFalse"]
561+
and infer.name in ("assertTrue", "assertFalse")
562562
):
563563
self.add_message(
564564
"redundant-unittest-assert",

pylint/checkers/typecheck.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def _emit_no_member(node, owner, owner_name, ignored_mixins=True, ignored_none=T
518518
and isinstance(owner.parent, astroid.ClassDef)
519519
and owner.parent.name == "EnumMeta"
520520
and owner_name == "__members__"
521-
and node.attrname in ["items", "values", "keys"]
521+
and node.attrname in ("items", "values", "keys")
522522
):
523523
# Avoid false positive on Enum.__members__.{items(), values, keys}
524524
# See https://github.com/PyCQA/pylint/issues/4123
@@ -1781,7 +1781,7 @@ def visit_compare(self, node):
17811781
return
17821782

17831783
op, right = node.ops[0]
1784-
if op in ["in", "not in"]:
1784+
if op in ("in", "not in"):
17851785
self._check_membership_test(right)
17861786

17871787
@check_messages(

pylint/lint/pylinter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def any_fail_on_issues(self):
717717
def disable_noerror_messages(self):
718718
for msgcat, msgids in self.msgs_store._msgs_by_category.items():
719719
# enable only messages with 'error' severity and above ('fatal')
720-
if msgcat in ["E", "F"]:
720+
if msgcat in ("E", "F"):
721721
for msgid in msgids:
722722
self.enable(msgid)
723723
else:

script/bump_changelog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def do_checks(content, next_version, version, version_type):
136136
wn_next_version = get_whats_new(next_version)
137137
wn_this_version = get_whats_new(version)
138138
# There is only one field where the release date is TBA
139-
if version_type in [VersionType.MAJOR, VersionType.MINOR]:
139+
if version_type in (VersionType.MAJOR, VersionType.MINOR):
140140
assert (
141141
content.count(RELEASE_DATE_TEXT) <= 1
142142
), f"There should be only one release date 'TBA' ({version}) {err}"

0 commit comments

Comments
 (0)