summaryrefslogtreecommitdiff
path: root/tests/functional/c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix return type checkers calls on ellipses functions (#5107)Daniël van Noord2021-10-061-0/+44
| | | Closes #4736
* Fix a crash if ``str.format`` is referenced without being called (#5109)Tim Martin2021-10-061-0/+8
| | | | | Closes #5058 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Make ``consider-using-f-string`` skip `format()` with backslash (#5055)Daniël van Noord2021-09-212-25/+36
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix bug with cell-var-from-loop and kw_defaults (#5045)David Liu2021-09-202-13/+29
| | | | | | | * Fix bug with cell-var-from-loop and kw_defaults * Use more efficient generator for defaults and add issue link * Fix test output for cellvar_escaping_loop Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Spelling and grammar fixesVille Skyttä2021-09-172-2/+2
|
* Make consider-iterating-dictionary consider membership check (#4997)Daniël van Noord2021-09-142-16/+49
|
* Extend consider-using-in for attribute accessMarc Mueller2021-09-052-1/+9
|
* Moved ``consider-using-f-string`` to `RecommendationChecker` (#4957)Daniël van Noord2021-09-031-30/+30
| | | | | Based on discussion in #4787 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Remove the python3 porting mode from the codebasePierre Sassoulas2021-09-012-2/+2
| | | | | | 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.
* Remove functional test configuration for python version <=3.6.0Pierre Sassoulas2021-08-304-6/+0
| | | | | We're only supporting python version > 3.6 so this became useless configuration.
* Implement basic control flow checks for ``consider-using-with`` (#4929)Andreas Finkler2021-08-302-6/+98
| | | | | | | * Add some control flow checks to consider-using-with in order to handle assignments in different branches * Use existing function from ``astroid`` to determine whether two statements are exclusive * Add unit tests for new utility methods * Add ChangeLog and whatsnew entry
* Add ``Consider-using-f-string`` checker (#4796)Daniël van Noord2021-08-302-0/+137
| | | | | | | | | | | | | | | | * 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>
* Suppress ``consider-using-with`` on return statementsDudeNr332021-08-151-0/+4
|
* Add a regression test for #4823Pierre Sassoulas2021-08-121-1/+15
|
* Fix bugs in W0640 cell-var-from-loop checker (#4827)David Liu2021-08-123-7/+102
| | | | | | | | | | | | | | * Fix bugs in W0640 cell-var-from-loop checker. 1. Handle cell var appearing in node inside function. 2. Handle cell var appearing in non-trivial default argument expression. 3. Use astroid's lookup method to account for variable shadowing. * Fix cell-var-from-loop dependency on other checks. Previously, this check would have many false negatives when both unused-variable and used-before-assignment were disabled. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add new checkers ``use-list-literal`` and ``use-dict-literal`` (#4769)Daniël van Noord2021-07-293-3/+3
| | | | | | | | | | | | | | | | | | | | | | * Add ``use-list-literal`` and ``use-dict-literal`` This adds two checks for when empty lists and dicts are created using a function call instead of their literals. This closes #4365 * Conform code to use-list-literal, use-dict-literal With addition of the use-list-literal and use-dict-literal checkers some code had to be updated. As there is a real performance difference, the literal is preferred when it is as clear as using the function call. * Conform test to use-list-literal, use-dict-literal With addition of the use-list-literal and use-dict-literal checkers some code had to be updated. As there is a real performance difference, the literal is preferred when it is as clear as using the function call. For some tests ignoring the checker seemed better for clarity of the test. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Add unspecified-encoding checker #3826 (#4753)Daniël van Noord2021-07-283-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix crash if a callable returning a context manager was assigned to a list ↵DudeNr332021-07-212-0/+16
| | | | | | or dict item (#4733) * Fix crash if left hand side of assignment is neither ``astroid.AssignName`` nor ``astroid.AssignAttr`` * Add ChangeLog and whatsnew entry
* Fix 4689 Exclude ``ThreadPoolExecutor`` and ``ProcessPoolExecutor`` from ↵DudeNr332021-07-202-33/+88
| | | | | | | | | | | | ``consider-using-with`` (#4721) * Do not immediately emit ``consider-using-with`` if a context manager is assigned to a variable. Instead check if it is used later on in a ``with`` block. * Enhance check to also work for tuple unpacking in assignments * Remove ``ThreadPoolExecutor`` and ``ProcessPoolExecutor`` from list of callables that trigger the ``consider-using-with`` message Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix false-positive 'consider-using-with' for ternary inside 'with' (#4679)DudeNr332021-07-061-1/+16
| | | | | As things like ternary conditionals may be used inside the items of a with, it is not enough to just check the first parent node to determine if the call is happening inside a with.
* Fix false-positive ``consider-using-with`` when using ↵DudeNr332021-07-041-0/+8
| | | | | | | | | ``contextlib.ExitStack`` (#4665) * Fix false-positive ``consider-using-with`` when using ``contextlib.ExitStack`` * Add ``whatsnew`` entry for #4654 * Python 3.6 needs special treatment - ``ExitStack`` did not inherit from ``_BaseExitStack`` until Python 3.7
* fix false positive of `consider-using-dict-items`Yu Shao, Pang2021-07-012-16/+36
|
* Recognize cached_property as property (#4594)Marc Mueller2021-06-193-0/+26
| | | Co-authored-by: Tiago Honorato <tiagohonorato1@gmail.com>
* Merge branch 'master' into misc-tasksPierre Sassoulas2021-06-122-79/+0
|\
| * Move consider-using-namedtuple-or-dataclass to CodeStyle extensionMarc Mueller2021-06-122-79/+0
| |
* | Move remaining extension fixturesMarc Mueller2021-06-103-44/+0
|/
* Revert "Fix existing tests"Marc Mueller2021-06-102-26/+26
|
* Move to new extension CodeStyleCheckerMarc Mueller2021-06-102-33/+0
|
* Change to consider-using-tupleMarc Mueller2021-06-103-8/+8
|
* Fix existing testsMarc Mueller2021-06-102-26/+26
|
* Add new checker consider-using-tuple-iteratorMarc Mueller2021-06-102-0/+33
|
* Update name for consider-using-namedtuple to include dataclass (#4536)Marc Mueller2021-06-023-10/+10
| | | | | * Change msg name to include dataclass * Update pylint ignores * Update tests
* Add new checker consider-using-namedtuple (#4517)Marc Mueller2021-05-312-0/+79
| | | | * Add new checker consider-using-namedtuple * Add disable for existing code base
* Fixed false negative of consider-using-enumerate on attributes (#4508)yushao22021-05-262-0/+13
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Consider using with no assign (#4476)DudeNr332021-05-173-18/+31
| | | | * Emit ``consider-using-with`` also if calls like ``open()`` are used without an assignment
* Implemented new check consider-using-dict-items (#4445)yushao22021-05-112-0/+101
| | | Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Issue 4430 false positive consider-using-with R1732 (#4453)DudeNr332021-05-094-29/+74
| | | | | * Suppress consider-using-with if used inside context manager * Added ChangeLog entry
* Enhancement #3413 ``consider-using-with`` (#4372)DudeNr332021-04-235-0/+178
| | | | | | | | * Implement consider-using-with check * Fix or disable consider-using-with in codebase * Fix ticket number in ChangeLog * Move functional test for ``open()`` into separate testfile and exclude this test from running with PyPy Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix crash min-max refactoring checker (#4380)Marc Mueller2021-04-191-0/+10
| | | | | * Fix crash min-max refactoring checker * Small update to test
* Enhancement/add checker consider using min max builtin (#4359)Qwiddle132021-04-172-0/+108
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: manderj <joffrey.mander+pro@gmail.com>
* New ConfusingConsecutiveElifCheckr (for: #3920) (#4318)DudeNr332021-04-113-0/+44
|
* Remove txt file during update for functional test without outputPierre Sassoulas2021-03-172-3/+0
|
* Fix existing 'use-symbolic-message-instead'Pierre Sassoulas2021-03-173-5/+3
|
* Fix false negative 'use-symbolic-message-instead' and optimize itPierre Sassoulas2021-03-174-4/+8
| | | | | | use-symbolic-message-instead was not working for message with multiple new names and the function to get the symbol was suboptimal. Also made the solution copy pastable.
* Cleanup unwanted 'use-symbolic-message-instead' in functional testsPierre Sassoulas2021-03-171-1/+1
|
* Enable use-symbolic-message-instead in functional testsPierre Sassoulas2021-03-175-5/+6
|
* Rename blacklisted-name to disallowed-namePeter Kolbus2021-03-092-2/+2
| | | | | | In the base checker, change the 'blacklisted-name' message to 'disallowed-name'. For backward compatibility, blacklisted-name is an old_name for disallowed-name.
* Migrate all func_noerror_* to new functional testsPierre Sassoulas2021-03-073-0/+77
|
* Create subdirectory for crowded functional testsPierre Sassoulas2021-03-0724-0/+0
|
* Add new `consider-using-generator` and 'use-a-generator' checkersIkraduya Edian2021-02-202-0/+13
| | | | | | | | See issue #3165 (#3309) See https://github.com/PyCQA/pylint/pull/3309#discussion_r576683109 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Daniel Hahler <github@thequod.de>