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

Expected override method from class will not warning invalid-name #4183

Closed
daoiqi opened this issue Mar 4, 2021 · 2 comments
Closed

Expected override method from class will not warning invalid-name #4183

daoiqi opened this issue Mar 4, 2021 · 2 comments
Labels
Duplicate 🐫 Duplicate of an already existing issue Enhancement ✨ Improvement to a component False Positive 🦟 A message is emitted but nothing is wrong with the code

Comments

@daoiqi
Copy link

daoiqi commented Mar 4, 2021

Steps to reproduce

#!/usr/bin/env python
# --coding:utf-8--

# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring

from http.server import BaseHTTPRequestHandler, HTTPServer


class TestHTTPServerRequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_error(500, "not found")


def run():
    port = 8000
    print("starting server, port", port)
    # Server settings
    server_address = ("", port)
    httpd = HTTPServer(server_address, TestHTTPServerRequestHandler)
    print("running server...")
    httpd.serve_forever()


if __name__ == "__main__":
    run()

Current behavior

Result of pylint a.py:

pylint test2.py
************* Module test2
test2.py:10:4: C0103: Method name "do_GET" doesn't conform to snake_case naming style (invalid-name)

------------------------------------------------------------------
Your code has been rated at 9.23/10 (previous run: 6.15/10, +3.08)

Expected behavior

Expected override method from class will not warning invalid-name

such as do_GET do_POST runTest

pylint --version output

Result of pylint --version output:

pylint --version output
pylint 2.7.2
astroid 2.5.1
Python 3.8.5 (default, Sep  4 2020, 02:22:02)
[Clang 10.0.0 ]
@dbaty
Copy link
Contributor

dbaty commented Mar 4, 2021

This is similar to #4060.

@Pierre-Sassoulas Pierre-Sassoulas added the Enhancement ✨ Improvement to a component label Jun 12, 2021
@Pierre-Sassoulas Pierre-Sassoulas added the False Positive 🦟 A message is emitted but nothing is wrong with the code label Sep 27, 2021
@Pierre-Sassoulas
Copy link
Member

Closing as duplicate of #4563. A temporary fix exists in #4060 (comment) (you can modify the regex to include your function name)

@Pierre-Sassoulas Pierre-Sassoulas closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2022
@Pierre-Sassoulas Pierre-Sassoulas added the Duplicate 🐫 Duplicate of an already existing issue label Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue Enhancement ✨ Improvement to a component False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
Development

No branches or pull requests

3 participants