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

Implemented unused-protected-member checker #4503

Closed
wants to merge 4 commits into from

Conversation

yushao2
Copy link
Collaborator

@yushao2 yushao2 commented May 25, 2021

Steps

  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Description

Implemented a new checker, unused-protected-member, which is emitted when a private member (i.e., begins with _) is defined within a class and unused

Check includes:

  • protected functions
  • protected class variables
  • protected instance attributes

Type of Changes

Type
✨ New feature

Related Issue

Closes #4483

@yushao2 yushao2 marked this pull request as draft May 25, 2021 02:19
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 91.827% when pulling 2daa286 on yushao2:checkers-4483 into fc28cec on PyCQA:master.

@yushao2 yushao2 closed this May 25, 2021
@@ -80,6 +80,11 @@ modules are added.
* Make ``using-constant-test`` detect constant tests consisting of list literals like ``[]`` and
``[1, 2, 3]``.

* New checker ``unused-protected-member``. Emitted when a protected member (i.e., starts with ``_``) of a class

Choose a reason for hiding this comment

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

It's OK situation (not a bug). Typically such methods defined for calling in children classes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, I realise this -- which was why i closed this PR.

Correct implementation here #4504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add check for unused private members
3 participants