pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.32k stars 1.14k forks source link

False positive when overriding `too-many-positional-arguments` #9942

Closed niall-byrne closed 1 month ago

niall-byrne commented 1 month ago

Bug description

When upgrading to 3.3.0 there seems to be a new bug where the config value for too-many-positional-arguments is not honoured, and it falls back to the default of 5.

Using pyproject.toml for settings.

Example:

def function_with_6_args(a, b, c, d, e, f):
  print(a, b, c, d, e, f)

Configuration

[tool.pylint.design]
max-args = 6

Command used

pylint a.py
pylint --rcfile pyproject.toml a.py

Pylint output

R0917: Too many positional arguments (6/5) (too-many-positional-arguments)

Expected behavior

The configuration override should be respected.

Pylint version

pylint 3.3.0
astroid 3.3.3
Python 3.9.16 (main, Jul  3 2023, 21:41:39)

OS / Environment

OSX Monterey

Additional dependencies

No response

jacobtylerwalls commented 1 month ago

Thanks for the report, but as doc'd in the release note, you need to use max-positional-arguments, not max-args.

The point of having the separate message is so that they can can be configured with separate options. Your project may be OK with 6 total args but no more than 5 positional, in which you would configure exactly as you have and desire the result you got.

niall-byrne commented 1 month ago

Thanks for replying with detail.