diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | doc/whatsnew/2.0.rst | 4 | ||||
-rw-r--r-- | pylint/checkers/logging.py | 7 |
3 files changed, 13 insertions, 3 deletions
@@ -250,6 +250,11 @@ Release date: tba Closes #1204 + * Bug-fix for false-positive logging-format-interpolation` when format specifications + are used in formatted string. + + Fixes #572 + What's new in Pylint 1.6.3? =========================== diff --git a/doc/whatsnew/2.0.rst b/doc/whatsnew/2.0.rst index 83a8c5d69..12699b6bc 100644 --- a/doc/whatsnew/2.0.rst +++ b/doc/whatsnew/2.0.rst @@ -858,6 +858,10 @@ Bug fixes may be a part of exposed API, this check is disabled by default. For enabling it, set ``allow-global-unused-variables`` option to false. +* Fix a false-positive ``logging-format-interpolation`` message, when format + specifications are used in formatted string. In general, these operations + are not always convertible to old-style formatting used by logging module. + Removed Changes =============== diff --git a/pylint/checkers/logging.py b/pylint/checkers/logging.py index be031a931..d9c1fd78b 100644 --- a/pylint/checkers/logging.py +++ b/pylint/checkers/logging.py @@ -57,8 +57,9 @@ MSGS = { } -CHECKED_CONVENIENCE_FUNCTIONS = {'critical', 'debug', 'error', 'exception', - 'fatal', 'info', 'warn', 'warning'} +CHECKED_CONVENIENCE_FUNCTIONS = { + 'critical', 'debug', 'error', 'exception', 'fatal', 'info', 'warn', 'warning' +} def is_method_call(func, types=(), methods=()): @@ -233,7 +234,7 @@ class LoggingChecker(checkers.BaseChecker): def is_complex_format_str(node): - """ Checks if node represents a string with complex formatting specs. + """Checks if node represents a string with complex formatting specs. Args: node (astroid.node_classes.NodeNG): AST node to check |