Commit Graph

15 Commits

Author SHA1 Message Date
Claudiu Popa
754ce1dffa Change the `logging-format-style` to use name identifier instead of their corresponding Python identifiers
This is to prevent users having to think about escaping the default value for
``logging-format-style`` in the generated config file. Also our config parsing
utilities don't quite support escaped values when it comes to ``choices`` detection,
so this would have needed various hacks around that.

Close #2614
2018-11-28 09:17:20 +01:00
Claudiu Popa
1ac83855b3 Forgot to update the documentation as well 2018-11-25 18:28:22 +01:00
Lucas Cimon
fcc01516ae Adding implicit-str-concat-in-sequence check (#1655)
``implicit-str-concat-in-sequence`` detects string concatenation inside lists, sets & tuples.
It would warn on code such as `('a', 'b' 'c')`.
2018-10-10 20:56:25 +03:00
Alan Chan
0dd573faae New option: logging-format-style for logging checker (#2521)
logging-format-style accepts one of '%' or '{', (defaults to '%'). When '{' is selected, logging
checker assumes str.format() style format strings for calls to the logging.

pylint was unable to count the required number of args for the format string when the
format string was using the `{` format. The new feature indirectly fixes that by allowing
the proper interpretation of that format string.
2018-10-04 09:28:36 +02:00
Sushobhit
47c258eee1 Fix utils.is_subclass_of to be aware of complex hierarchies (#2508) 2018-09-28 14:06:20 +02:00
Claudiu Popa
1dab987204 Add a new check, `duplicate-string-formatting-argument`
This new check is emitted whenever a duplicate string formatting argument
is found.

Close #497
2018-09-05 10:16:37 +02:00
Yury Gribov
ba62048e04 Added checker for format string type mismatches. 2018-09-04 10:41:57 +02:00
Sushobhit
e3cb6d4a99 Emit unused-import instead of unused-variable when dealing with unused imports
When pylint encounters unused imports in scopes (e.g. functions),
it used to emit `unused-variable`. This is somewhat confusing, as those
names are not necessarily variables, so instead let's emit the more
obvious `unused-import`.

Close #2421
2018-08-31 10:10:08 +02:00
Claudiu Popa
66cb32187c Handle asyncio.coroutine when looking for `not-an-iterable` check.
Close #996
2018-08-24 10:38:16 +02:00
Claudiu Popa
0ba4519947 Pick the latest value from the inferred values when looking for `raising-non-exception`
Close #2431
2018-08-22 09:33:44 +02:00
Claudiu Popa
cbc70dc2d8 Fix some typos 2018-08-22 08:57:23 +02:00
Caio Carrara
1d0753b0f7 Fix is_subclass_of when one param is not ClassDef
Currently the function `checkers.utils.is_subclass_of()` is raising a
`NoneType object has no attribute name` exception when only one of the
arguments (nodes) is `None`.

This change fix that updating the function to make sure all params are
an instance of `astroid.ClassDef` before the proper check
2018-08-22 08:24:55 +02:00
ssolanki
28a2690021 fix false positive `undefined-variable`
and ``used-before-assignment`` with nonlocal keyword usage.

incorporate review comments

fix existing test case
2018-08-17 11:43:02 +05:30
ssolanki
3176bbbb6a Ignore import x.y.z as z cases for checker
`useless-import-alias`
2018-08-15 14:35:12 -04:00
ssolanki
917dee7892 add whatsnew/2.2.rst 2018-08-09 15:47:05 +05:30