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

Add guard helper functions from astroid #5122

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Oct 6, 2021

Description

Followup to the discussion here: #5107 (comment)

Add is_typing_guard and is_sys_guard helper functions to pylint.checkers.utils.

--
Deprecation astroid: pylint-dev/astroid#1202

/CC: @Pierre-Sassoulas @DanielNoord

@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Oct 6, 2021
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.12.0 milestone Oct 6, 2021
>>> from typing import TYPE_CHECKING
>>> if TYPE_CHECKING:
>>> from xyz import a
"""
Copy link
Member

Choose a reason for hiding this comment

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

I think keeping the docstring from astroid with the astroid parsing make sense too. (We just have to change the call from node.is_...() to is_...(node)). (I started to implement this this morning).

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure it's necessary. They are only meant as examples anyway.

@coveralls
Copy link

coveralls commented Oct 6, 2021

Pull Request Test Coverage Report for Build 1313933146

  • 11 of 11 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 93.125%

Totals Coverage Status
Change from base Build 1313706531: 0.005%
Covered Lines: 13409
Relevant Lines: 14399

💛 - Coveralls

@cdce8p cdce8p merged commit d98c29d into pylint-dev:main Oct 6, 2021
@cdce8p cdce8p deleted the add_guard-helper-functions branch October 6, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants