summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Apply suggestions from code reviewdeprecate-is-sys-guardPierre Sassoulas2021-10-061-3/+4
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Deprecate is_typing_guard and is_sys_guardPierre Sassoulas2021-10-062-0/+13
| | | | References #1199
* Use 3.10 for Github actions (#1198)Marc Mueller2021-10-051-4/+4
| | | | | | * Use 3.10 for Github actions Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix ``relative-beyond-top-level`` false positive (#1186)Daniël van Noord2021-10-057-2/+34
| | | * Fix ``relative-beyond-top-level`` false positive
* Bug pylint 4326 (#1183)hippo912021-10-056-7/+159
| | | | | | | * Adds unittest dealing with class subscript * Adds support of type hints inside numpy's brains * Adds unit test to check astroid does not crash if numpy is not available
* [pre-commit.ci] pre-commit autoupdate (#1197)pre-commit-ci[bot]2021-10-051-1/+1
| | | | | | updates: - [github.com/asottile/pyupgrade: v2.28.0 → v2.29.0](https://github.com/asottile/pyupgrade/compare/v2.28.0...v2.29.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Improve brain for typing.Callable + typing.Type (#1192)Marc Mueller2021-09-293-16/+63
|
* Feature / Bug Fix: Brain for the stdlib signal module (#1172)SupImDos2021-09-292-0/+158
| | | | | | | | | | | * Added brain for stdlib signal module, for dynamically generated IntEnums. * Added static definitions for Signals, Handlers and Sigmasks enums. * Moved sys.platform checks outside of generated code. * Added note to brain_signal docstring. * Added unit tests for brain_signal.py.
* continuing #839: Extend attrs brain to support provisional APIs (#1187)Jonathan Striebel2021-09-283-4/+38
| | | | | | | | * Extend attrs brain to support provisional APIs See https://www.attrs.org/en/stable/api.html?highlight=field#provisional-apis Co-authored-by: Tamir Bahar <tbahar@vdoo.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* [pre-commit.ci] pre-commit autoupdate (#1191)pre-commit-ci[bot]2021-09-282-2/+2
| | | | | | | | | | | | * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v2.26.0 → v2.28.0](https://github.com/asottile/pyupgrade/compare/v2.26.0...v2.28.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Remove deprecation warning raised by own astroid code (#1190)Pierre Sassoulas2021-09-252-2/+2
| | | Following comment here: https://github.com/PyCQA/astroid/issues/1072\#issuecomment-925471310
* Bug pylint 4960 (#1176)hippo912021-09-254-5/+90
| | | | | | | | | | | * Revert modifications of PR 1148. While it is probably still a good idea to prevent nodes that are dynamically imported to be inferred through an astroid's brain, the way it was done in builder.py was incorrect. The way it was done, lead to prevent the use of astroid legetimate brains even for node that was not dynamically loaded. * Adds a brain to infer the numpy.ma.masked_where function Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix regression on Compare node inference (#1185)Daniël van Noord2021-09-213-1/+18
| | | This deals with PyCQA/pylint#5048
* [pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]2021-09-201-2/+2
| | | | | | updates: - [github.com/psf/black: 21.8b0 → 21.9b0](https://github.com/psf/black/compare/21.8b0...21.9b0) - [github.com/pre-commit/mirrors-prettier: v2.4.0 → v2.4.1](https://github.com/pre-commit/mirrors-prettier/compare/v2.4.0...v2.4.1)
* Small improvements to Compare infer (#1182)Marc Mueller2021-09-181-3/+5
|
* Fix regression on ClassDef inference (#1181)Daniël van Noord2021-09-173-1/+12
|
* Support dataclass inference for pydantic.dataclasses.David Liu2021-09-172-7/+10
|
* Add f-strings with `flynt`Daniël van Noord2021-09-1723-198/+125
|
* Fix all R6201: Consider using set for membershipPierre Sassoulas2021-09-1712-19/+19
| | | | Following the upgrade to pylint 2.11.1
* Upgrade to pylint 2.11 in pre-commit configurationPierre Sassoulas2021-09-172-1/+4
|
* Add typing to scope() (#1170)Daniël van Noord2021-09-1511-19/+65
|
* Add Arguments typing to Lambda + FunctionDef (#1174)Daniël van Noord2021-09-151-19/+5
|
* Fix documentation after changes to astroid.nodes (#1175)Marc Mueller2021-09-153-171/+169
|
* Bump astroid to 2.8.0, update changelogv2.8.0Pierre Sassoulas2021-09-1415-13/+31
|
* Add inference of Compare nodes (#979)Andrew Haigh2021-09-142-2/+351
| | | | | | | | | | | * Add inference for Compare nodes Ref #846. Identity checks are currently Uninferable as there is no sensible way to infer that two Instances refer to the same object without accurately modelling control flow. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add typing in tests directory (#1163)Pierre Sassoulas2021-09-1421-1133/+1338
| | | | | | | * Add typing in the tests/ directory * Add some assert for mypy's sake * Avoid adding mypy_extension by using pytest skip
* [pre-commit.ci] pre-commit autoupdate (#1171)pre-commit-ci[bot]2021-09-141-2/+2
| | | | | | | updates: - [github.com/asottile/pyupgrade: v2.25.0 → v2.26.0](https://github.com/asottile/pyupgrade/compare/v2.25.0...v2.26.0) - [github.com/pre-commit/mirrors-prettier: v2.3.2 → v2.4.0](https://github.com/pre-commit/mirrors-prettier/compare/v2.3.2...v2.4.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add node_ancestors method (#1169)Nick Drozd2021-09-133-12/+13
| | | | | | | | | I've been thinking about ways to get rid of unbounded `while` loops in the Pylint codebase. A common use is to loop over a node's ancestors. The `node_ancestors` method centralizes this logic in one place so that those `while` loops can be rewritten as `for`. A few uses are made of this new method. It only comes up a few places in Astroid, but there are many more in Pylint.
* Add typing to NodeNG.nodes_of_class (#1168)Daniël van Noord2021-09-132-11/+53
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Fix crash on datafields (#1165)Daniël van Noord2021-09-133-2/+31
| | | | | | | | | | | | | | | * Fix crash on datafields Fixes the crash reported at PyCQA/pylint#4963 Tests added there. * Change to ``if not`` * Update astroid/brain/brain_dataclasses.py * Add tests * Update and merge test * Use ``raise UseInferenceDefault``
* Support pyz imports (#1161)grayjk2021-09-103-1/+19
| | | | | | * Support pyz imports Closes PyCQA/pylint#3887
* Recognize nested classes in classes inherited from NamedTupleDimitri Prybysh2021-09-062-7/+28
| | | | Fixes PyCQA/pylint#4370
* Add ``astroid.objects.ExceptionInstance`` importDaniël van Noord2021-09-041-0/+1
| | | | | With typing added to parts of the code in ``pylint`` it has become useful to import this class so ``pylint`` can access it. See discussion in: https://github.com/PyCQA/pylint/pull/4940
* Add Statement to the astroid.nodes APIPierre Sassoulas2021-09-041-0/+2
| | | | Closes #1162
* Import from astroid.nodes everywhere in the testsPierre Sassoulas2021-09-047-77/+78
| | | | This is the standard in pylint, and should be for all external code.
* Deprecate some default values for node init calls (#1157)Marc Mueller2021-09-027-8/+193
| | | | | | | | | | | * Fix missing name value * Add deprecation warnings to Name nodes * Add deprecation warnings to Attribute nodes * Add deprecation warnings for op attribute * Add deprecation warning to Import nodes * Add missing 'can be None' comment * Add changelog entry * Use decorator to emit DeprecationWarnings * Require typing-extensions>=3.10
* [pre-commit.ci] pre-commit autoupdatepre-commit-ci[bot]2021-08-301-2/+2
| | | | | | updates: - [github.com/asottile/pyupgrade: v2.24.0 → v2.25.0](https://github.com/asottile/pyupgrade/compare/v2.24.0...v2.25.0) - [github.com/psf/black: 21.7b0 → 21.8b0](https://github.com/psf/black/compare/21.7b0...21.8b0)
* Move back to a dev version following 2.7.3 releasePierre Sassoulas2021-08-302-2/+2
|
* Bump astroid to 2.7.3, update changelogv2.7.3Pierre Sassoulas2021-08-3012-10/+22
|
* Import from astroid.nodes directly Pierre Sassoulas2021-08-301-1/+1
| | | | | Sometime it's already possible. see https://github.com/PyCQA/astroid/pull/1141#discussion_r698479656 Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Use TYPE_CHECKING guard to remove a circular importPierre Sassoulas2021-08-301-2/+4
|
* astroid.context: import object one by one instead of the entire modulePierre Sassoulas2021-08-309-65/+78
|
* Do not import entire module in astroid/bases.pyPierre Sassoulas2021-08-301-27/+33
|
* Do not import entire module in astroid/arguments.pyPierre Sassoulas2021-08-301-26/+25
|
* Import specific objects instead of the whole base packagePierre Sassoulas2021-08-301-5/+5
|
* More precise import in astroid/bases.py for a circulat importPierre Sassoulas2021-08-301-2/+2
|
* Bug pylint 3342 (#1148)hippo912021-08-297-11/+83
| | | | | | | | | | | | | | | | | | | | | * Adds some type hints * Adds a logger module * Remove this useless module * It is probably not a good idea to apply transforms on module which have been authorized to be directly imported * Adds a function named is_module_name_part_of_extension_package_whitelist which returns True if the beginning of a module dotted name is part of the package whitelist in argument * Adds the extension_package_whitelist variable to the brainless manager in order unittest dealing with this managert to be ok * Adds two tests that check the behavior of the is_module_name_part_of_extension_package_whitelist function * Updating Changelog * Adds explanation to the ChangeLog entry Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Bug pylint 4896 (#1154)hippo912021-08-293-0/+188
| | | | | | | | | | * Adds a brain for the ctypes module and a unittest associated * Another approach to handle ctypes module * Update the unittest to take into account the brain_ctypes_bis definition. Adds more tests to be sure that the minimum has been modified through the brain * Forget this method because the predicate is too large and applies the function for a too broad range of value attributes (i.e for value attribute that do not have a link with the ctypes module)
* Fixed inference bug with chained attributes and inheritanceDavid Liu2021-08-283-17/+36
|
* Fixed inference bug with unbound inherited methodsDavid Liu2021-08-283-5/+140
|