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

No message for badly styled __init__ method arguments #3614

Closed
lcerman opened this issue May 12, 2020 · 0 comments · Fixed by #5079
Closed

No message for badly styled __init__ method arguments #3614

lcerman opened this issue May 12, 2020 · 0 comments · Fixed by #5079
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component
Milestone

Comments

@lcerman
Copy link

lcerman commented May 12, 2020

Steps to reproduce

  1. create file foo_bar.py:
class FooBar:
    def __init__(self, fooBar):
        self._foo_bar = fooBar

    def foo_bar(self, foo_bar_arg):
        print(self._foo_bar + foo_bar_arg)

    def bar_bar(self, foo_bar_arg):
        print(self._foo_bar + foo_bar_arg)
  1. Run: pylint foo_bar

Current behavior

No complaints about the fooBar argument (should be snake_case).

Expected behavior

Issues a message that fooBar is not in snake_case style.

The following example issues correctly foo_bar.py:6:4: C0103: Argument name "fooBarArg" doesn't conform to snake_case naming style (invalid-name) for the foo_bar method, but not for the __init__ method.

class FooBar:
    def __init__(self, fooBar):
        self._foo_bar = fooBar

    def foo_bar(self, fooBarArg):
        print(self._foo_bar + fooBarArg)

    def bar_bar(self, foo_bar_arg):
        print(self._foo_bar + foo_bar_arg)

Edit: it does so with the default settings and with my custom settings with I have added as attachement.
pylintrc.txt

pylint --version output

pylint 2.5.2
astroid 2.4.1
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
@PCManticore PCManticore added Checkers Related to a checker Enhancement ✨ Improvement to a component labels May 14, 2020
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.11.2 milestone Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants