summaryrefslogtreecommitdiff
path: root/pylint/pyreverse/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Bump pylint to 2.11.0, update changelogv2.11.0Pierre Sassoulas2021-09-161-1/+1
|
* Add ``Consider-using-f-string`` checker (#4796)Daniël van Noord2021-08-301-4/+4
| | | | | | | | | | | | | | | | * Add ``consider-using-f-string`` checker This adds a checker for normal strings which are formatted with ``.format()`` or '%'. The message is a convention to nudge users towards using f-strings. This closes #3592 * Update pylint code to use f-strings After adding `consider-using-f-strings` the codebase showed numerous cases of formatting which could be f-strings. This commit changes most of these to become f-strings, or adds ignores. * Apply suggestions from code review Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Bump pylint to 2.10.0, update changelogv2.10.0Pierre Sassoulas2021-08-201-0/+1
|
* Use alias for astroid.nodes 04 (#4869)Marc Mueller2021-08-191-9/+10
| | | | | | | | | * Use alias for astroid nodes 04 * Resolve name conflicts * Apply suggestions from code review Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* pyreverse - Handle a regression with typehints of type astroid.Subscript (#4859)Mark Byrne2021-08-181-0/+2
| | | | | | | | | | | | | | | | | * pyreverse - Handle a regression with typehints of type astroid.Subscript Closes #4845 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * pyreverse - Handle a regression with typehints of type astroid.Subscript - Add test-case to pyreverse data files Closes #4845 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Create common ``Printer`` base class for ``pyreverse`` and improve typing. ↵Andreas Finkler2021-08-031-0/+14
| | | | | | | (#4731) * Create common ``Printer`` base class for Pyreverse, and improve typing. * Use ``abc.ABC`` as metaclass for ``Printer`` instead of raising ``NotImplementedError`` * Rename ``vcgutils.py`` to ``vcg_printer.py``
* Handle has-a relationships for type-hinted arguments in class diagrams (#4745)Mark Byrne2021-07-301-3/+3
| | | | | | | * Pyreverse - Show class has-a relationships inferred from type-hints Closes #4744 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add unspecified-encoding checker #3826 (#4753)Daniël van Noord2021-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add unspecified-encoding checker #3826 This adds an unspecified-encoding checker that adds a warning whenever open() is called without an explicit encoding argument. This closes #3826 * Update tests to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added, or the message has been disabled. This also includes small linting changes to a small number of tests. Their test-data has been updated to reflect new line numbers. * Update scripts to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. * Update pylint to conform to unspecified-encoding With addition of the unspecified-encoding checker calls of open() need an encoding argument. Where necessary this argument has been added. Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Bump pylint to 2.9.3, update changelogv2.9.3Pierre Sassoulas2021-07-011-0/+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, update changelog, add python 3.10 to package metav2.9.0Pierre Sassoulas2021-06-291-0/+1
|
* Add type annotations to pyreverse (#4551)Mark Byrne2021-06-261-0/+60
| | | | | | | | | | | | | | | | | * Add type annotations to pyreverse dot files Closes #1548 - Indicate the attribute is optional in the dot files by inspecting the default value. - Handle the Subscript type annotations - Refactor & move the logic to obtain annotations to utils.py as re-usable functions - Add unittests for the added functions - Add a try/except to deal with a possible InferenceError when using NodeNG.infer method - Create a function in utils and so remove repeated logic in inspector.py - Add unittests to check the InferenceError logic - Adjust the types in function input
* Bump pylint to 2.9.0-dev1, update changelogPierre Sassoulas2021-06-171-0/+1
|
* Consider using with no assign (#4476)DudeNr332021-05-171-1/+2
| | | | * Emit ``consider-using-with`` also if calls like ``open()`` are used without an assignment
* Rename copying to license and upgrade the setup.cfg (#4338)Pierre Sassoulas2021-04-111-1/+1
|
* Apply copyrite --contribution-thresholdPierre Sassoulas2021-02-211-1/+3
|
* Fix E266 too many leading '#' for block commentPierre Sassoulas2021-02-151-9/+2
|
* Bug: fix vulnerable regexes to avoid potential ReDoS.yeting li2020-09-101-3/+2
| | | | Fix issue #3811
* Update formatting following black and isort updatePierre Sassoulas2020-09-101-8/+4
|
* Sets up copyrighthippo912020-08-201-1/+1
|
* Add missing copyright annotations for the past releasesClaudiu Popa2020-04-271-1/+4
|
* pyupgrade: automated removal of python2 constructsAnthony Sottile2020-03-241-1/+1
| | | | | | | | | | | | | 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/) ```
* Allow non-ASCII characters in identifiers in the invalid-name rule and add ↵bernie gray2020-03-111-5/+5
| | | | | | | non-ascii-name check Non-ASCII characters are now allowed by ``invalid-name`` check. Also this commit adds a new check ``non-ascii-name``, which is used to detect identifiers with non-ASCII characters.
* Remove redundant compatibility code (#3097)Hugo van Kemenade2019-09-121-2/+0
| | | | We no longer support Python 2 so we can remove the compatibility code we had in place for that version.
* Fix a bunch of linting errors from the codebaseClaudiu Popa2019-05-221-2/+3
|
* Reformat the code with blackClaudiu Popa2018-09-171-31/+45
|
* Update copyright noticesClaudiu Popa2018-07-151-1/+2
|
* fix lint issue w.r.t useless-object-inheritance.ssolanki2018-06-201-2/+2
|
* Regenerate copyright noticesClaudiu Popa2017-12-151-0/+4
|
* Adding a check for ``inconsistent-return-statements`` inside function or ↵hippo912017-09-261-1/+2
| | | | | methods. (#1641) Close #1267
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-231-2/+3
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
| | | | | This was changed automatically in #894, but apparently we need to have the copyright notice somewhere.
* Add the new shorter license header, including to missing files. Close #894.Claudiu Popa2016-06-011-15/+3
|
* Change the attribute check for using hasattr instead of looking explicitly ↵Claudiu Popa2015-12-081-1/+1
| | | | into __dict__.
* New imported features from astroid into pyreverse.Claudiu Popa2015-07-031-2/+3
| | | | | | We moved pyreverse.inspector.Project, pyreverse.inspector.project_from_files and pyreverse.inspector.interfaces. These were moved since they didn't belong in astroid and they can be better maintained inside pyreverse itself.
* astroid.utils.LocalsVisitor was moved to pylint.pyreverse.LocalsVisitor.Claudiu Popa2015-06-171-0/+77
|
* Move all package files to a pylint package.Ionel Cristian Maries2015-02-141-0/+132