Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused-import to checkdummy-variables-rgx #8566

Merged
merged 5 commits into from
Apr 12, 2023

Conversation

RSTdefg
Copy link
Contributor

@RSTdefg RSTdefg commented Apr 12, 2023

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Fixed unused-import so that it observes the dummy-variables-rgx option. Also added one testcase to test this behavior.

Closes #8500

@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Merging #8566 (53a8696) into main (1a1452a) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8566      +/-   ##
==========================================
- Coverage   95.91%   95.91%   -0.01%     
==========================================
  Files         174      174              
  Lines       18370    18369       -1     
==========================================
- Hits        17619    17618       -1     
  Misses        751      751              
Impacted Files Coverage Ξ”
pylint/checkers/variables.py 97.16% <100.00%> (-0.01%) ⬇️

@github-actions

This comment has been minimized.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good first contribution, thank you ! This also fixed a false positive in pylint which is why the pylint check is failing :)

@RSTdefg
Copy link
Contributor Author

RSTdefg commented Apr 12, 2023

Pretty good first contribution, thank you ! This also fixed a false positive in pylint which is why the pylint check is failing :)

That's what I figured as well!

Copy link
Contributor Author

@RSTdefg RSTdefg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.17.3 milestone Apr 12, 2023
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘Œ

@Pierre-Sassoulas Pierre-Sassoulas merged commit 0cd41b1 into pylint-dev:main Apr 12, 2023
39 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 12, 2023
Resolve #8500

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
(cherry picked from commit 0cd41b1)
@github-actions
Copy link
Contributor

πŸ€– Effect of this PR on checked open source code: πŸ€–

Effect on psycopg:
The following messages are no longer emitted:

  1. unused-import:
    Unused _psycopg imported from psycopg_c as _psycopg
    https://github.com/psycopg/psycopg/blob/ea350698605972d9f941701f3c0e7057c911face/psycopg/psycopg/_cmodule.py#L16

Effect on pytest:
The following messages are no longer emitted:

  1. unused-import:
    Unused format_explanation imported from _pytest.assertion.util as _format_explanation
    https://github.com/pytest-dev/pytest/blob/6dcd652d4a55bacda01a15017e155caa816e15a5/src/_pytest/assertion/rewrite.py#L35

This comment was generated for commit 53a8696

Pierre-Sassoulas pushed a commit that referenced this pull request Apr 12, 2023
Resolve #8500

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
(cherry picked from commit 0cd41b1)

Co-authored-by: RSTdefg <34202999+RSTdefg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unused-import should observe dummy-variables-rgx setting
2 participants