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

Address pylint 3.3 messages #2575

Merged
merged 1 commit into from
Sep 22, 2024
Merged

Address pylint 3.3 messages #2575

merged 1 commit into from
Sep 22, 2024

Conversation

jacobtylerwalls
Copy link
Member

No description provided.

@jacobtylerwalls jacobtylerwalls added Maintenance Discussion or action around maintaining astroid or the dev workflow backport maintenance/3.3.x labels Sep 22, 2024
Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.06%. Comparing base (58286a1) to head (9399ec7).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2575   +/-   ##
=======================================
  Coverage   93.06%   93.06%           
=======================================
  Files          93       93           
  Lines       11064    11064           
=======================================
  Hits        10297    10297           
  Misses        767      767           
Flag Coverage Δ
linux 92.95% <100.00%> (ø)
pypy 93.06% <100.00%> (ø)
windows 93.04% <100.00%> (ø)

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

Files with missing lines Coverage Δ
astroid/bases.py 88.29% <ø> (ø)
astroid/exceptions.py 97.45% <100.00%> (ø)
astroid/nodes/_base_nodes.py 94.25% <ø> (ø)
astroid/nodes/node_classes.py 94.94% <ø> (ø)
astroid/nodes/scoped_nodes/scoped_nodes.py 93.19% <100.00%> (ø)
astroid/typing.py 100.00% <ø> (ø)

Comment on lines +310 to +312
# Maximum number of positional arguments for function / method.
max-positional-arguments=8

Copy link
Member

Choose a reason for hiding this comment

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

Kinda bad that we're forcing everyone upgrading to add this. Should we use the max-args value by default ?

Copy link
Member

Choose a reason for hiding this comment

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

And release it in 3.3.1 asap

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know, seems presumptuous to me. There are several options, fixing it, disabling it, adding inline disables for egregious cases. Doesn't seem any different to me than the usual pylint minor upgrade where each new check has to be evaluated. We called out in the release note that this new check has its own setting.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, defaulting one setting to the other is pretty bad: the max-positional-arguments default should always be strictly lower than max-args. It's already not great that the defaults are the same.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with your point that the default should be less than max-args, but it seems like it's something that should be fixed in a major. If you already had max-args=12 in the code imo it means you wanted to disable all existing too-many-arguments while still guaranteeing that it's not getting worse either (i.e. your acceptable number of positional args is going to be high too). It also pretty much means that your going to have new too-many-positional-arguments raised when upgrading which is bad for a minor.
Also, too-many-positional-arguments is a refactor message: annoying to remove and probably not something that will be default when pylint become "sane" in 4.0.

Copy link
Member Author

Choose a reason for hiding this comment

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

(i.e. your acceptable number of positional args is going to be high too)

I guess I don't think we can assume that.

I'm keeping an open mind, but I just think every pylint minor comes with estimating the cost of complying with every new message.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough.

@jacobtylerwalls jacobtylerwalls merged commit 706fcdb into main Sep 22, 2024
22 checks passed
@jacobtylerwalls jacobtylerwalls deleted the fix-pylint-3.3-msgs branch September 22, 2024 13:14
github-actions bot pushed a commit that referenced this pull request Sep 22, 2024
(cherry picked from commit 706fcdb)
jacobtylerwalls pushed a commit that referenced this pull request Sep 22, 2024
* Address pylint 3.3 messages (#2575)

(cherry picked from commit 706fcdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport maintenance/3.3.x Maintenance Discussion or action around maintaining astroid or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants