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.3k stars 1.13k forks source link

Redeclared names without usage rule #3471

Open nikolaik opened 4 years ago

nikolaik commented 4 years ago

Question

Is there an equivalent pylint rule to PyCharm's inspection Redeclared names without usage?

With the example code:

class OptionType(graphene.InputObjectType):
    freeform_enabled = graphene.Boolean(required=True)
    freeform_enabled = GenericScalar(required=True)

PyCharm would give the warning: Screenshot from 2020-04-02 19-28-46

PCManticore commented 4 years ago

There is not, but looks useful.

neesara commented 4 years ago

Hello, can some one please guide me on how to work on this issue?

Pierre-Sassoulas commented 2 years ago

Hello @neesara sorry for the time it took to reply. Did you check the contributor documentation ?

DanielNoord commented 2 years ago

I'm not sure if this should be in the same message, but flagging on the following pattern would be nice as well:

lines = ["a"]
lines += ["b"]

We would need to think about:

lines = ["a"]
line = get_lines()
lines += [line]

Don't think this should be part of initial implementation, but a generic name for this message would help.