summaryrefslogtreecommitdiff
path: root/pylint/checkers/python3.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove the python3 porting mode from the codebasePierre Sassoulas2021-09-011-1432/+0
| | | | | | 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.
* ``astroid.const.BUILTINS`` use removed for clarity and so astroid can also ↵Pierre Sassoulas2021-08-191-5/+3
| | | | | | | | | | | | | 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 02 (#4863)Marc Mueller2021-08-181-39/+40
| | | | * Use alias for astroid nodes * Resolve name conflicts
* Revert "Extended consider-using-tuple check to cover 'in' comparisons (#4768)"Marc Mueller2021-08-121-1/+1
| | | | This reverts commit ca3bc53fd8d628473fba25c7736d0abfac8e4a4a.
* Extended consider-using-tuple check to cover 'in' comparisons (#4768)Marc Mueller2021-07-291-1/+1
|
* Fix copyright links (#4647)Marc Mueller2021-07-011-1/+1
| | | | * Fix link in license header * Update link to astroid bump_changelog
* Bump pylint to 2.9.0-dev1, update changelogPierre Sassoulas2021-06-171-0/+1
|
* Fix existing codeMarc Mueller2021-06-101-2/+2
|
* Bump pyupgrade from 2.16.0 to 2.18.1 (#4496)dependabot[bot]2021-05-241-9/+7
| | | | | | | | | | | | | | | | * 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>
* Update copyrite noticev2.8.2Pierre Sassoulas2021-04-261-0/+1
|
* Changes after black updateMarc Mueller2021-04-261-1/+1
|
* Rename copying to license and upgrade the setup.cfg (#4338)Pierre Sassoulas2021-04-111-1/+1
|
* Prepare 2.7.3 release (#4261)pylint-2.7.32.7Pierre Sassoulas2021-03-291-0/+1
|
* Import astroid with import x or from x import y but not bothPierre Sassoulas2021-03-281-4/+5
| | | | Remove unused imports for astroid
* Fix 'assert' statement contains an expression with side effectsPierre Sassoulas2021-03-251-2/+4
|
* Remove 'whitelist' term in python3 checkerPeter Kolbus2021-03-091-2/+2
| | | | Replace usage of a whitelist parameter in checkers.python3.
* Apply copyrite --contribution-thresholdPierre Sassoulas2021-02-211-2/+4
|
* Remove the # coding, since PEP3120 the default is UTF8Pierre Sassoulas2021-02-211-1/+0
|
* Fix false positive when map() receives iterableTiago Honorato2021-02-201-0/+1
| | | | | | | Since map() supports iterables, it should not issue builtin-not-iterating for iterable arguments. Signed-off-by: Tiago Honorato <tiagohonorato1@gmail.com>
* Fix false positive when zip() receives iterable (#4105)tiagohonorato2021-02-191-0/+1
| | | | | | | | 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>
* Move from format() to f-string where it makes sensePierre Sassoulas2021-02-161-4/+4
| | | | As we do not maintain python 3.5 it permit to simplify some code
* Update formatting following black and isort updatePierre Sassoulas2020-09-101-2/+1
|
* Sets up copyrighthippo912020-08-201-1/+3
|
* Chore: use https links (#3679)谭九鼎2020-06-111-1/+1
|
* Rename the new old-style super with super-with-argumentsClaudiu Popa2020-05-051-20/+0
| | | | | Also move it from the Python 3 checker to the refactoring one, as it's a better fit for it.
* Add new old-style-super check to flag instances of super with default argumentsFederico Bond2020-05-051-1/+21
|
* Add missing copyright annotations for the past releasesClaudiu Popa2020-04-271-4/+15
|
* pyupgrade: automated removal of python2 constructsAnthony Sottile2020-03-241-3/+2
| | | | | | | | | | | | | 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/) ```
* Fix false positive for inverse containment testsAthos Ribeiro2020-01-061-1/+1
| | | | | | | | | | | | 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>
* Enable else-if-used extension (#3316)Nick Drozd2019-12-241-5/+4
| | | After all, if we don't use this, why should anybody else?
* Move the set construction for _infer_if_relevant_attr at the class levelClaudiu Popa2019-10-301-4/+5
|
* Speedup py3k modeHugues Bruant2019-10-301-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Fixes "exception-escape" false positive with generators (#3128) (#3182)Gabriel R Sezefredo2019-10-161-9/+4
| | | | | | | 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>
* Remove redundant compatibility code (#3097)Hugo van Kemenade2019-09-121-20/+11
| | | | We no longer support Python 2 so we can remove the compatibility code we had in place for that version.
* Do not scope the iterating contexts to builtinsClaudiu Popa2019-09-101-2/+1
| | | | | | | This caused issues detecting that `OrderedDict` and similar non-builtin predefined iterable consumers where not in fact in an *iterating* context. Close #3075
* [pylint.checkers] Make the link between msgid and symbol strictly 1-1Pierre Sassoulas2019-08-191-6/+6
| | | | | Will permit to improve performance with less check but more importantly simplify the message store a lot.
* fix old-division check for int(...) (#2892)Anthony Sottile2019-04-301-5/+9
|
* Refactor - Avoid intra-packages circular dependencies for constantsPierre Sassoulas2019-03-291-1/+1
| | | | | | | | 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.
* Style - Apply isort on all apllicable filesPierre Sassoulas2019-03-201-5/+4
|
* Modify range-builtin-not-iterating message (#2810)bluesheeptoken2019-03-191-1/+1
|
* ``old-division`` is not emitted for non-Const nodes.Claudiu Popa2019-03-111-0/+7
| | | | Close #2808
* Don't emit ``*-not-iterating`` checks for builtins consumed by ``itertools``Claudiu Popa2019-02-111-8/+8
| | | | Close #2731
* Exempt starred unpacking from ``*-not-iterating`` Python 3 checksClaudiu Popa2018-12-181-0/+2
| | | | Close #2651
* Exempt ``yield from`` from ``*-not-iterating`` Python 3 checks.Claudiu Popa2018-12-141-0/+3
| | | | Close #2643
* Fix zip-builtin-not-iterating false positive with OrderedDict (#2634)sbagan2018-12-101-0/+1
| | | | Add OrderedDict as accepting iterator
* Adding implicit-str-concat-in-sequence check (#1655)Lucas Cimon2018-10-101-5/+5
| | | | | ``implicit-str-concat-in-sequence`` detects string concatenation inside lists, sets & tuples. It would warn on code such as `('a', 'b' 'c')`.
* dict-iter-method and dict-view-method no longer determines if the operand is ↵Claudiu Popa2018-10-021-20/+4
| | | | | | | 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.
* Reformat the code with blackClaudiu Popa2018-09-171-580/+925
|
* Remove wrong modules from 'bad-python3-import' (#2454)Aivar Annamaa2018-09-091-2/+2
| | | | Close #2453
* first make mypy pass by ignoring typessolanki2018-08-211-1/+2
|