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

Require astroid 2.5.7 #4523

Merged
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
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ modules are added.

Closes #4518

* ``invalid-length-returned``, now also works when nothing at all is returned
following an upgrade in astroid.

* ``logging-format-interpolation`` and ``logging-not-lazy``, now works on logger
class created from renamed logging import following an upgrade in astroid.


What's New in Pylint 2.8.2?
===========================
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_min.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-e .
astroid==2.5.6 # Pinned to a specific version for tests
astroid==2.5.7 # Pinned to a specific version for tests
pytest~=6.2
pytest-benchmark~=3.4
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ project_urls =
[options]
packages = find:
install_requires =
astroid>=2.5.6,<2.7
astroid>=2.5.7,<2.7
isort>=4.2.5,<6
mccabe>=0.6,<0.7
toml>=0.7.1
Expand Down
7 changes: 7 additions & 0 deletions tests/functional/i/invalid/l/invalid_length_returned.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def __len__(self): # [invalid-length-returned]
return lambda: 3


class NonRegression(object):
""" __len__ returns nothing """

def __len__(self): # [invalid-length-returned]
print(3.0)


class AmbigousLen(object):
""" Uninferable return value """
__len__ = lambda self: Missing
Expand Down
1 change: 1 addition & 0 deletions tests/functional/i/invalid/l/invalid_length_returned.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
invalid-length-returned:38:4:FirstBadLen.__len__:__len__ does not return non-negative integer
invalid-length-returned:45:4:SecondBadLen.__len__:__len__ does not return non-negative integer
invalid-length-returned:52:4:ThirdBadLen.__len__:__len__ does not return non-negative integer
invalid-length-returned:59:4:NonRegression.__len__:__len__ does not return non-negative integer
4 changes: 2 additions & 2 deletions tests/functional/l/logging_format_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ class Logger(renamed_logging.Logger):
pass

custom_logger = Logger('three')
custom_logger.info('testing {0}'.format('info'))
custom_logger.info('testing %s' % 'info')
custom_logger.info('testing {0}'.format('info')) # [logging-format-interpolation]
custom_logger.info('testing %s' % 'info') # [logging-not-lazy]
2 changes: 2 additions & 0 deletions tests/functional/l/logging_format_interpolation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ logging-format-interpolation:17:43::Use lazy % formatting in logging functions
logging-format-interpolation:18:22::Use lazy % formatting in logging functions
logging-format-interpolation:19:43::Use lazy % formatting in logging functions
logging-format-interpolation:20:21::Use lazy % formatting in logging functions
logging-format-interpolation:36:19::Use lazy % formatting in logging functions
logging-not-lazy:37:0::Use lazy % formatting in logging functions
2 changes: 1 addition & 1 deletion tests/functional/n/no/no_self_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def method(self):

def __len__(self):
"""no i can not be a function"""
print(42)
return 42

def __cmp__(self, other):
"""no i can not be a function"""
Expand Down