langflow
langflow copied to clipboard
Clean up code and format with PyLint
Hi, @MarkusSagen. Is pylint better than mypy?
We have a github workflow that runs mypy.
Hi @ogabrielluiz
Good question, mypy and pylint serve complementary purposes
mypy is used to ensure that the type hints are correct
pylint will ensure that the quality of the code is correct, check that the code conforms to PEP8. pylint allows one to catch things like:
- If a variable is defined in a global scope with a name as a local variable
- If we do unneeded calls to the inherited classes methods when it is not needed, or if we are overriding a classes method when it is not needed, etc
If it would be of interest, I think this blog post is a fairly good explanation on their respective differences: https://lynn-kwong.medium.com/use-black-mypy-and-pylint-to-make-your-python-code-more-professional-b594512f4362
Sure thing! 👍
why not use ruff instead?
@ngmisl We are. It looks like they do the same things, is that correct?
@ngmisl We are. It looks like they do the same things, is that correct?
Yes it is. In fact, ruff is rust based and supposed to be a lot faster than pylint: https://github.com/charliermarsh/ruff#ruff