| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
It's possible to use the python3 porting checker from
an older pylint version. But it's not evolving anymore
and was costing resource to maintain.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removes it later (#4868)
* Simplify the way builtins is used (remove astroid dependencies)
* Replace the constant BUILTINS by the string 'builtins'
This make for clearer and also slightly faster code (means time
seems to decrease by 0.68% with this change alone (astroid/pylint)
in the pylint tests benchmarks). Done because we were using an
import from astroid from astroid.bases for one of those, which is
kinda messy.
|
|
|
|
| |
* Use alias for astroid nodes
* Resolve name conflicts
|
|
|
|
| |
This reverts commit ca3bc53fd8d628473fba25c7736d0abfac8e4a4a.
|
| |
|
|
|
|
| |
* Fix link in license header
* Update link to astroid bump_changelog
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Bump pyupgrade from 2.16.0 to 2.18.1
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.16.0 to 2.18.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.16.0...v2.18.1)
Signed-off-by: dependabot[bot] <support@github.com>
* Update pre-commit-config
* Changes after pyupgrade update
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Remove unused imports for astroid
|
| |
|
|
|
|
| |
Replace usage of a whitelist parameter in checkers.python3.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Since map() supports iterables, it should not issue
builtin-not-iterating for iterable arguments.
Signed-off-by: Tiago Honorato <tiagohonorato1@gmail.com>
|
|
|
|
|
|
|
|
| |
Since zip() supports iterables, it should not be an issue
builtin-not-iterating for iterable arguments.
Signed-off-by: Tiago Honorato <tiagohonorato1@gmail.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
| |
As we do not maintain python 3.5 it permit to simplify some code
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Also move it from the Python 3 checker to the refactoring one, as it's a
better fit for it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
using configuration:
```yaml
- repo: https://github.com/asottile/pyupgrade
rev: v2.1.0
hooks:
- id: pyupgrade
args: [--py3-plus, --keep-percent-format]
exclude: ^tests/(extensions/data/|functional/|input/|regrtest_data/)
```
|
|
|
|
|
|
|
|
|
|
|
|
| |
While dict-keys-not-iterating does not generate false positives for the
'in' containment test, the check does generate false positives for the
inverse counterpart of the containment test, 'not in'. This patch
changes the check behavior to also consider the 'not in' operator as an
iterating context.
* Relates to #2186
Signed-off-by: Athos Ribeiro <athoscr@fedoraproject.org>
|
|
|
| |
After all, if we don't use this, why should anybody else?
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid costly inference in visit_call and visit_attribute
when the attribute name is one that cannot possibly trigger
a message.
This typically leads to a 30-50% speedup when running pylint
in python3 porting mode on most codebases.
Benchmark results on pylint's own code, on a 2018 macbook pro,
with python 3.6.8, using `hyperfine`.
pylint-2.4.2
```
Time (mean ± σ): 10.071 s ± 1.136 s [User: 9.724 s, System: 0.246 s]
Range (min … max): 9.352 s … 12.015 s 5 runs
```
pylint-2.4.2 + this patch
```
Time (mean ± σ): 6.282 s ± 0.046 s [User: 6.099 s, System: 0.155 s]
Range (min … max): 6.232 s … 6.327 s 5 runs
```
|
|
|
|
|
|
|
| |
As reported on #3128, there is a bug when the handler bound object is being used inside a generator causing a false positive. This was due to the way we were identifying if the object was "inside" its handler or not. In the previous implementation we would visit the node parents until we reached the object scope (in the generator case, the scope of the node is the generator, not the handler), while this change continues to go up the parent stack until it reaches its parent handler, or, if it's not inside its handler, it reaches the module's parent (None).
Object is considered inside its handler if it reaches it by going up in the parent chain. It's considered outside its handler if it reaches None.
Signed-off-by: Gabriel R Sezefredo <g@briel.dev>
|
|
|
|
| |
We no longer support Python 2 so we can remove
the compatibility code we had in place for that version.
|
|
|
|
|
|
|
| |
This caused issues detecting that `OrderedDict` and similar non-builtin
predefined iterable consumers where not in fact in an *iterating* context.
Close #3075
|
|
|
|
|
| |
Will permit to improve performance with less check but more
importantly simplify the message store a lot.
|
| |
|
|
|
|
|
|
|
|
| |
Some constants were package internal but were used by multiple
packages. This created circular dependencies. By creating a
file for constants we make sure this does not happen because
we won't import everything important in this file and every
thing else can depend on it.
|
| |
|
| |
|
|
|
|
| |
Close #2808
|
|
|
|
| |
Close #2731
|
|
|
|
| |
Close #2651
|
|
|
|
| |
Close #2643
|
|
|
|
| |
Add OrderedDict as accepting iterator
|
|
|
|
|
| |
``implicit-str-concat-in-sequence`` detects string concatenation inside lists, sets & tuples.
It would warn on code such as `('a', 'b' 'c')`.
|
|
|
|
|
|
|
| |
a dictionary
This inhibits the capability of the check of finding occurrences of these methods. There's a low
chance of having a false positive.
|
| |
|
|
|
|
| |
Close #2453
|
| |
|