Skip to content

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Oct 11, 2025

Description

In pylint there are two cases where we iterate over all annotations nodes of Arguments specifically to check if a specific node is one of them. Getting that check right is sometimes tricky as it's easy to forget something. Add a helper method get_annotations() similar to the existing get_children() to return an iterator of all annotation nodes.

https://github.com/pylint-dev/pylint/blob/91d57ad7ed5ca52efafa232dda996757ccf14352/pylint/checkers/utils.py#L1619-L1626
https://github.com/pylint-dev/pylint/blob/91d57ad7ed5ca52efafa232dda996757ccf14352/pylint/checkers/variables.py#L2213-L2220

@cdce8p cdce8p added this to the 4.1.0 milestone Oct 11, 2025
@cdce8p cdce8p added the Enhancement ✨ Improvement to a component label Oct 11, 2025
Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.35%. Comparing base (92e320f) to head (4ba76f1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2860   +/-   ##
=======================================
  Coverage   93.34%   93.35%           
=======================================
  Files          92       92           
  Lines       11176    11190   +14     
=======================================
+ Hits        10432    10446   +14     
  Misses        744      744           
Flag Coverage Δ
linux 93.21% <100.00%> (+<0.01%) ⬆️
pypy 93.35% <100.00%> (+<0.01%) ⬆️
windows 93.33% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
astroid/nodes/node_classes.py 95.01% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

LGTM but probably need some coverage.

@cdce8p
Copy link
Member Author

cdce8p commented Oct 11, 2025

LGTM but probably need some coverage.

Yeah, working on it.

@Pierre-Sassoulas Pierre-Sassoulas merged commit ab119c2 into pylint-dev:main Oct 11, 2025
19 checks passed
@cdce8p cdce8p deleted the args-annotations branch October 11, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement ✨ Improvement to a component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants