Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ranges for error messages #6606

Merged
merged 2 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ Release date: TBA

Ref #6536

* Update ranges for ``using-constant-test`` and ``missing-parentheses-for-call-in-test``
error messages.

..
Insert your changelog randomly, it will reduce merge conflicts
(Ie. not necessarily at the end)
Expand Down
3 changes: 3 additions & 0 deletions doc/whatsnew/2.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ Other Changes

Refs #6595

* Update ranges for ``using-constant-test`` and ``missing-parentheses-for-call-in-test``
error messages.

Deprecations
============

Expand Down
6 changes: 3 additions & 3 deletions pylint/checkers/base/basic_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _check_using_constant_test(self, node, test):
inferred = utils.safe_infer(test)

if emit:
self.add_message("using-constant-test", node=node)
self.add_message("using-constant-test", node=test)
elif isinstance(inferred, const_nodes):
# If the constant node is a FunctionDef or Lambda then
# it may be an illicit function call due to missing parentheses
Expand All @@ -329,12 +329,12 @@ def _check_using_constant_test(self, node, test):
for inf_call in call_inferred:
if inf_call != astroid.Uninferable:
self.add_message(
"missing-parentheses-for-call-in-test", node=node
"missing-parentheses-for-call-in-test", node=test
)
break
except astroid.InferenceError:
pass
self.add_message("using-constant-test", node=node)
self.add_message("using-constant-test", node=test)

def visit_module(self, _: nodes.Module) -> None:
"""Check module name, docstring and required arguments."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ missing-raises-doc:148:4:148:18:Foo.foo_method:"""AttributeError"" not documente
unreachable:158:8:158:17:Foo.foo_method:Unreachable code:UNDEFINED
unreachable:180:8:180:17:Foo.foo_method:Unreachable code:UNDEFINED
missing-raises-doc:183:4:183:18:Foo.foo_method:"""AttributeError"" not documented as being raised":UNDEFINED
using-constant-test:190:8:191:34:Foo.foo_method:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:190:11:190:15:Foo.foo_method:Using a conditional statement with a constant value:UNDEFINED
30 changes: 15 additions & 15 deletions tests/functional/m/missing/missing_parentheses_for_call_in_test.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
missing-parentheses-for-call-in-test:29:0:30:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:35:0:36:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:43:0:44:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:51:0:52:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:56:0:57:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:64:0:65:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:70:11:70:38::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:72:17:72:42::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:73:18:73:46::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:75:0:None:None::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:76:0:None:None::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:79:0:None:None::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:80:0:None:None::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:85:0:86:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:91:0:92:8::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:29:3:29:16::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:35:3:35:19::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:43:3:43:23::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:51:5:51:25::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:56:3:56:14::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:64:3:64:17::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:70:17:70:30::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:72:23:72:34::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:73:24:73:38::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:75:26:75:39::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:76:26:76:37::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:79:26:79:40::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:80:26:80:42::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:85:3:85:26::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
missing-parentheses-for-call-in-test:91:3:91:20::Using a conditional statement with potentially wrong function or method call due to missing parentheses:UNDEFINED
52 changes: 26 additions & 26 deletions tests/functional/u/using_constant_test.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
using-constant-test:22:0:23:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:26:0:27:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:29:0:30:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:32:0:33:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:35:0:36:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:38:0:39:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:41:0:42:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:44:0:45:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:47:0:48:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:50:0:51:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:53:0:54:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:56:0:57:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:59:0:60:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:62:0:63:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:65:0:66:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:68:0:69:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:73:0:74:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:76:3:76:16::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:80:0:None:None:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:81:0:None:None:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:82:0:None:None:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:83:0:None:None:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:84:0:None:None:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:85:0:None:None:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:89:0:90:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:93:0:94:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:22:3:22:14::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:26:3:26:31::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:29:3:29:15:<lambda>:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:32:3:32:11::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:35:3:35:8::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:38:3:38:4::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:41:3:41:7::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:44:3:44:5::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:47:3:47:6::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:50:3:50:6::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:53:3:53:5::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:56:3:56:12::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:59:3:59:12::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:62:3:62:5::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:65:3:65:12::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:68:3:68:5::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:73:3:73:12::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:76:8:76:9::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:80:36:80:39:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:81:36:81:37:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:82:36:82:39:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:83:36:83:37:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:84:36:84:39:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:85:39:85:42:test_comprehensions:Using a conditional statement with a constant value:UNDEFINED
using-constant-test:89:3:89:15::Using a conditional statement with a constant value:UNDEFINED
using-constant-test:93:3:93:18::Using a conditional statement with a constant value:UNDEFINED
comparison-of-constants:117:3:117:8::"Comparison between constants: '2 < 3' has a constant value":HIGH