Pylint configuration Issues
Asked Answered
A

1

8

On pylint 1.4.1, Im trying to set the configurations according to my desired python conventions.

with that, I encountered several issues:

  1. when using old-style class I get C1001 Warning ("Old-style class defined"), which I want to suppress.

    How can I set pylint to allow this kind of class? suppressing C1001 only partially helps (since I also get an error for not having __ init __ function in my class, which I don't want to suppress in every class - it is usefull in new-style classes).

  2. when defining:

    class MyException(Exception):
        pass
    

    and in another module defining and using:

    class MyError(MyException):
        pass
    

    I get a warning in pylint, saying: W0710: Exception doesn't inherit from standard "Exception" class

    is there a way to set it so it will also check the inheritance hirarchy?

  3. is there a way to set my own warning? i.e. not allowing usage of " " for a string (only ' '), or """ """ for docstring (only ''' ''')?

thanks.

Advise answered 2/3, 2015 at 15:16 Comment(2)
For issue 3 I suggest you check out existing question #36490628.Marcheshvan
For issue 1 I suggest you ckeck out existing question #4342246Fulfill
P
1

Regarding 1, this is python 2.7 specific so I guess you moved toward python 3 but if not at least you should upgrade to the latest python 2.7 compatible pylint (>1.9,<2).

Regarding 2, this is a bug and it has been fixed in latest version of pylint.

Regarding 3, you can create your own checker or in this case use an existing one using pip install pylint-quotes

Prefabricate answered 5/8, 2021 at 12:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.