| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
This check warn for comparison with bare callable, without calling it.
|
|
|
|
|
|
|
|
|
| |
This patch adds lints for two more cases:
1) `if len(X) < 1:`
2) `if len(X) <= 0:`
Meaning of the both is same as `if not X`.
Signed-off-by: Matej Marusak <mmarusak@redhat.com>
|
| |
|
|
|
|
|
|
|
| |
Given an import, we'll emit this error whenever pylint finds an alias
with the same name as the import module.
Close #2052.
|
|
|
| |
Close #2083
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new command-line option for the use of continuous integration
scripts which abort if a command returns a non-zero status code. If the
option is specified, and Pylint runs successfully, it will exit with 0
regardless of the number of lint issues detected.
Configuration errors, parse errors, and calling Pylint with invalid
command-line options all still return a non-zero error code, even if
`--exit-zero` is specified.
Thanks for hosting a sprint at PyCon 2018!
Close #2042
|
|
|
|
|
|
| |
Nested scopes don't reset reset the `too-many-statements` check
state.
Close #1978
|
|
|
|
| |
default
|
|
|
|
| |
documenting a NotImplementedError.
|
|
|
|
|
|
|
|
| |
A new check `logging-fstring-interpolation` is added.
It emits a warning when f-string is used within logging
function calls.
Fixes https://github.com/PyCQA/pylint/issues/1998
|
|
|
|
|
|
|
| |
This test checks that we don't compare a value with itself,
which might suggest some potential bug or an honest mistake.
Fixes #2051
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default report format in mypy, pydocstyle, and other tools includes the file path so that the user of certain terminals (e.g. iTerm) can click on each warning to open that line in their editor.
For example, here is what the default mypy output looks like:
framework/views/billing.py:92: error: Incompatible return value type (got "View", expected
"DashboardTab")
With this new format, pylintoutput looks like:
framework/views/dashboards.py:21:8: W0612: Unused variable 'x' (unused-variable)
Note that some editors (e.g. Sublime Text) index columns from 1, so this will place the cursor one column to the left of the warning.
|
|
|
|
|
|
|
| |
This commit does two things:
* Change `it's name should` to `its name should`
* Update CONTRIBUTORS.txt
Thanks for holding a sprint at PyCon!
|
|
|
| |
Close #1195
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numpydoc specification allows for optional return value name in the form
of:
```
Returns
-------
name : type
Some description
```
These were not being honored by the current regex for return lines. This
adds an optional, non-capturing group to the regex which accounts for
the `name : ` bit.
Fixes #2030
|
|
|
|
|
|
| |
Inner functions don't need to be documented, as they are not part of a public API.
Fixes PyCQA/pylint#1956
|
|
|
|
|
|
|
|
| |
reports on except handlers where raise is the first operator
in the handler body. Reports on either bare raise or when we're
raising the same type of exception as the one that is being
handled.
Update existing tests to ignore the new error condition.
|
| |
|
| |
|
| |
|
|
|
|
| |
Closes #1120
|
| |
|
| |
|
|
|
|
|
| |
warns about a single "return" or "return None" statement at the
end of functions or methods
|
| |
|
| |
|
|
|
| |
Close #1774
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shallow copy of os.environ doesn't work as people may expect. os.environ
is not a dict object but rather a proxy object, so any changes made
on the copy may have unexpected effects on os.environ
Instead of copy.copy(os.environ) method os.environ.copy() should be
used.
Message id is: `shallow-copy-environ`
See https://bugs.python.org/issue15373 for details.
Resolves: #1301
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Extend trailing-comma-tuple check to more complex assignments
The previous implementation was too conservative with looking for
previous tokens associated with assignment: It looked only
at the immediately previous token, causing 'a = (5),' to not be
caught.
Now The current implementation backtracks to the start of the line
to find an assignment substring.
Fixes issue #1713
|
|
|
|
|
| |
implementation
A method can reimplement a super method in order to provide a different default value, in which case we shouldn't emit ``useless-super-delegation``.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bad (now causing a new warning):
raise SomeError('message about %s', foo)
raise SomeError('message about {}', foo)
Good (likely intended):
raise SomeError('message about %s' % foo)
raise SomeError('message about {}'.format(foo))
People used to printf in C might accidentally write a comma to separate a
message format containing % placeholders from the arguments to substitute,
instead of the % sign required to actually do the formatting and build the
error message as a single string. But even when using {…} as a placeholder,
some libraries will prefer deferred evaluation for e.g. logging calls, so a
user might have a habit of using commas instead of a str.format() call for
those, too. This warning points out such use cases. It can be ignored on
projects which deliberately use lazy formatting at all user-facing exception
handlers.
|
|
|
|
|
|
|
|
|
| |
Add 2 different error codes for different params defined
Split param name checking in two functions, one for missing checks
and another for different names checks
Check for missing params and then check for differing params
Minor fix in type of found_argument_names [list --> set]
Fixes #1342
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Closes #919
|
|
|
|
|
| |
This rule verifies that an if statement does not have an else branch,
preceded by a return statement inside the if branch.
|
| |
|
|
|
|
|
|
| |
module. (#1185)
This also triggered a "Rule of 3" refactoring for me to generalize warning about
accessing a given attribute on a module.
|
| |
|
|
|
|
|
|
| |
* Add new checker len-as-condition
* Fix len(SEQUENCE) warnings discovered by new checker
|
| |
|
|
|
|
|
|
| |
* Report when __slots__ is a simple string and not a non-string container
* Update ChangeLog
|
|
|
|
|
|
|
| |
codecs. (#1172)
These codecs were removed from the type restricted convenience methods on
`str`, `bytes`, and `bytearray` in Python 3.4 and produce inconsistent output
with their counterparts in `codecs`
|