summaryrefslogtreecommitdiff
path: root/tests/functional/u/undefined
Commit message (Collapse)AuthorAgeFilesLines
* Fix `used-before-assignment` false positive for `TYPE_CHECKING` elif branch ↵Zen Lee2023-03-301-1/+1
| | | | | | imports (#8441) Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* [PyCQA migration] Upgrade links to the repositories in code and doc (#8514)Pierre Sassoulas2023-03-298-19/+19
|
* Fix FP for used-before-assignment with assignment expressions in containers ↵Jacob Walls2023-02-112-6/+9
| | | | (#8253)
* Fix `used-before-assignment` false positive for TYPE_CHECKING if/elif/else ↵Zen Lee2023-02-072-11/+31
| | | | usage (#8071)
* Fix unreleased false positives with `used-before-assignment` (#7921)Jacob Walls2022-12-121-0/+4
| | | | | Cases with NamedExpr and Starred relating to definitions under "always false" conditions added in https://github.com/PyCQA/pylint/pull/6677
* Prevent `used-before-assignment` for variables defined in assignment ↵Jacob Walls2022-11-252-4/+5
| | | | expressions (#7847)
* Emit `used-before-assignment` for variables only defined under always false ↵Jacob Walls2022-11-222-0/+6
| | | | tests (#6677)
* Fix `valid-metaclass-classmethod-first-arg` default value (#7791)Cubicpath2022-11-191-2/+2
| | | | | * Change default value to "mcs" * Fix functional tests to use "mcs" for first MetaClass classmethod arg
* Rename `broad-except` and new check `broad-exception-raised` (#7709)Dani Alcala2022-11-051-1/+1
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Move `consider-using-augmented-assign` to `CodeStyle` extension (#7628)Marc Mueller2022-10-161-1/+1
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add ``consider-using-augmented-assign`` checker (#7514)Daniël van Noord2022-09-221-1/+1
| | | | Co-authored-by: clavedeluna <danalitovsky+git@gmail.com> Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
* Fix `undefined-loop-variable` with `NoReturn` and `Never` (#7476)Daniël van Noord2022-09-194-4/+43
| | | | Co-authored-by: detachhead <detachhead@users.noreply.github.com> Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
* Fix `used-before-assignment` for functions/classes defined in type checking ↵Rogdham2022-08-272-9/+18
| | | | | | guard Close #7368
* Fix `undefined-loop-variable` from walrus in comprehension test (#7324)Jacob Walls2022-08-202-0/+10
|
* fix `undefined-loop-variable` with `break` and `continue` statements in ↵DetachHead2022-08-192-1/+19
| | | | | | | | | `else` blocks (#7318) Also add better regex explanation for news fragments following hard to fix issue with it. Co-authored-by: detachhead <detachhead@users.noreply.github.com>
* Remove Python 2 code from the tests & refactor (#7320)Mark Byrne2022-08-183-52/+50
| | | | | | | - Refactor Classes which inherit from `object`. - Remove `import print_function from __future__`. - Remove assignments to `__revision__` from the functional test module when it is never used throughout the module. Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix crash when using `enumerate` in a ternary expression (#7132)Jacob Walls2022-07-052-1/+8
|
* Emit `used-before-assignment` for self-referencing assignments under if ↵Jacob Walls2022-06-152-0/+6
| | | | conditions (#6958)
* Fix ``undefined-variable`` for ``__class__`` in inner methods (#6957)Daniël van Noord2022-06-152-8/+14
|
* Avoid raising `undefined-loop-variable` twice on same line (#6925)Jacob Walls2022-06-122-0/+9
|
* Warn about self-referencing named expressions lacking prior assignments (#6915)Jacob Walls2022-06-122-8/+16
|
* Fix false positive for `undefined-loop-variable` with `enumerate()` (#6602)Jacob Walls2022-05-131-0/+7
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Move no-self-use to optional extension (#6448)Marc Mueller2022-05-052-2/+2
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* C2901 & C2902: New checks for unnecessary lambda expression usage (#6004)Joe Young2022-05-043-41/+43
| | | | | Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Update tests and testoptions for PyPyDaniël van Noord2022-05-031-1/+3
|
* Fix false positive for `undefined-loop-variable` for lambda in first of two ↵Jacob Walls2022-05-011-0/+20
| | | | | | loops (#6479) Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix a false positive for `undefined-loop-variable` when a loop else raises ↵Jacob Walls2022-05-011-0/+16
| | | | | | or returns (#6480) Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Prevent false positive `undefined-variable` for user-specified builtins ↵Jacob Walls2022-04-192-0/+17
| | | | given type annotations (#6392)
* Remove the 'no-init' message tat was not emitted anywayPierre Sassoulas2022-04-182-2/+2
| | | | | | See https://github.com/PyCQA/pylint/issues/2409#issuecomment-1100952171 Closes #2409
* Fix handling of "for x in x" homonyms (#6154)Jacob Walls2022-04-032-2/+1
| | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Use ``node.position`` in ``add_message`` if available (#5897)Daniël van Noord2022-03-121-3/+3
|
* Fix #5112: Prevent `used-before-assignment` if named expression found first ↵Jacob Walls2022-02-172-0/+15
| | | | | in container (#5812) Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix false positive `used-before-assignment` for named expressions in ternary ↵Jacob Walls2022-02-021-0/+16
| | | | operators (#5748)
* Remove moot TODO (#5747)Jacob Walls2022-01-302-4/+3
| | | Changing the message type occurred in 0fb6a120c6f0fbc94e305542fe29e790274be096 and updating this unit test to match took place in fa2b6ceca796311a918e28770d101b53a43f84f3.
* Fix #5399: Fix false negatives for further variable messages for invalid ↵Jacob Walls2022-01-292-1/+14
| | | | type annotations or default arguments (#5727)
* Add confidence level `CONTROL_FLOW` (#5709)Jacob Walls2022-01-262-14/+14
|
* Fix test conflicts after merging two valid MR incompatible together (#5726)Jacob Walls2022-01-262-4/+4
| | | After f85fb8d975d17f411e5f91ed2d5f21ba999e121e, certain unused type annotations raise `used-before-assignment` rather than `undefined-variable`. The subsequent commit `0fb6a120c6f0fbc94e305542fe29e790274be096` was drafted before the prior change was made, and it addressed a related false negative, so this commit just applies the intended change of message type.
* Fix #5713: Emit `used-before-assignment` instead of `undefined-variable` ↵Jacob Walls2022-01-262-89/+2
| | | | | | when accessing unused type annotations (#5718) * Add confidence level HIGH to `used-before-assignment`
* Fix false negative for `undefined-variable` (#5711)Jacob Walls2022-01-262-1/+19
| | | | | | | For unused type annotation after the same name appears multiple times in a comprehension Fix #5654 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix #5568: Allow nested classes as return annotations (#5688)Jacob Walls2022-01-161-0/+15
| | | | Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix false positive for `unused-variable` for a comprehension variable ↵Jacob Walls2022-01-102-3/+19
| | | | | | | matching a type annotation (#5651) * Close #5326
* Fix ``used-before-assignment`` for assignment expressions in lambda (#5530)Daniël van Noord2021-12-211-0/+11
|
* Fix #4761: Emit `used-before-assignment` where single assignment only made ↵Jacob Walls2021-12-112-2/+4
| | | | | | in except blocks (#5402) Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Move ``TestVariablesChecker`` to functional tests (#5419)Daniël van Noord2021-11-284-0/+58
|
* Update functional test expected output (#5349)Daniël van Noord2021-11-244-54/+54
| | | | | | * Add ``confidence`` to all expected functional test outputs * Make OutputLine accept end_line and end_column Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Add control flow check for ``undefined-variable`` in ``if ... else``Daniël van Noord2021-10-262-1/+52
| | | | Closes #3688
* Add tests for assignment expressions in function defaults (#5188)Daniël van Noord2021-10-252-1/+36
| | | | | | | | | * Add tests for assignment expressions in function defaults Ref #3688 * Upgrade astroid to 2.8.4 Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix regression for ``_is_only_type_assignment`` (#5163)Daniël van Noord2021-10-235-37/+112
| | | | | | | | | | | | | | | | * Fix regression for ``_is_only_type_assignment`` This closes #5162 * Remove references to `name` * Better tests for assignment * Move walrus tests to different file * Fix tests with incorrect typing * Update typing of `defstmt` Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Make ``undefined-variable`` check line numbers of metaclass parametersDaniël van Noord2021-10-182-0/+11
|
* Add test for #4021Daniël van Noord2021-10-182-8/+21
| | | | This closes #4021