PyFlakes is a widely used static analysis tool for Python. Having support for it, like pep8, would allow to: - check for defined but unused imports; - check for defined but unused variables However this would require a little parsing from pyflakes as it also reports undefined names, something that kdev-python already does. Reproducible: Always
It's a valid wish, but it would probably be easier to do this completely in kdev-python instead of integrating flake. Both features should be just few lines of code to write.
Interesting checks nice to have inside: - Imported but unused - redefinition of unused variable - list comprehension that redefines variable - import shadowed by variable - undefined name in __all__ - duplicate argument in function definition - redefinition of variable - future imports after other statements - variable assigned but never used Those should be the most interesting ones.
Thinking of it, don't we have a seperate plugin (an unfinished one?) for this kind of checks? Andreas, can you comment on that? Cheers
I have no clue what you're talking about :) Aleix once worked on something to cleanup includes in c++, but that was c++ specific afaik.
Yeah, you know, Aleix, Andreas... it's easy to mix up... *ducks* I'm sorry! I meant to ping aleix ;)
We have the ILanguageCheck and ILanguageChecksProvider interface so that you can run whatever you want against a file, then add the problems that have been found to the TopDUChain so that they can be displayed in the UI or wherever you want. You can see the kdevchecksrunner plugin for more information about it. I'll be working on this, so if you have any idea about it, don't hesitate to tell me.
Okay, good to know! I guess this would be the best way to do it, then. I'll surely want to work it at some point in the future, I'll come back to you then.