Skip to content

Commit

Permalink
[invalid-class-object] Set the confidence correctly for the check
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas committed Sep 16, 2022
1 parent 4f2e1bc commit 4530626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pylint/checkers/classes/class_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ def _check_invalid_class_object(self, node: nodes.AssignAttr) -> None:
):
# If is uninferable, we allow it to prevent false positives
return
self.add_message("invalid-class-object", node=node)
self.add_message("invalid-class-object", node=node, confidence=INFERENCE)

def _check_in_slots(self, node: nodes.AssignAttr) -> None:
"""Check that the given AssignAttr node
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/i/invalid/invalid_class_object.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
invalid-class-object:20:0:20:11::Invalid __class__ object:UNDEFINED
invalid-class-object:21:0:21:11::Invalid __class__ object:UNDEFINED
invalid-class-object:50:8:50:22:Pylint7429Good.class_defining_function_bad:Invalid __class__ object:UNDEFINED
invalid-class-object:58:15:58:29:Pylint7429Good.class_defining_function_bad_inverted:Invalid __class__ object:UNDEFINED
invalid-class-object:62:15:62:29:Pylint7429Good.class_defining_function_complex_bad:Invalid __class__ object:UNDEFINED
invalid-class-object:20:0:20:11::Invalid __class__ object:INFERENCE
invalid-class-object:21:0:21:11::Invalid __class__ object:INFERENCE
invalid-class-object:50:8:50:22:Pylint7429Good.class_defining_function_bad:Invalid __class__ object:INFERENCE
invalid-class-object:58:15:58:29:Pylint7429Good.class_defining_function_bad_inverted:Invalid __class__ object:INFERENCE
invalid-class-object:62:15:62:29:Pylint7429Good.class_defining_function_complex_bad:Invalid __class__ object:INFERENCE

0 comments on commit 4530626

Please sign in to comment.