PyLops / pylops

PyLops – A Linear-Operator Library for Python
https://pylops.readthedocs.io
GNU Lesser General Public License v3.0
431 stars 102 forks source link

Use ruff instead of flake8 for linting #485

Closed rohanbabbar04 closed 1 year ago

rohanbabbar04 commented 1 year ago

Use ruff instead of flake8

mrava87 commented 1 year ago

Hello, I am not sure about changing something we used for long time and are satisfied with. @cako is currently away, once he is back at work he can give us his opinion as he introduced flake8 support to pylops.

cako commented 1 year ago

I think ruff has a lot of potential, but I am hesitant port over to it right now for two reasons:

  1. Ruff does not support pattern matching. The fix for this should be coming soon.
  2. Ruff does not flag errors which are fixed by black. I understand we are using black as a pre-commit hook, but pre-commit hooks are not mandatory and can be bypassed. I would hate to be missing linting suggestions because someone at some point did not use black.

For those reasons I would rather wait until ruff becomes more mature before moving the whole project over to it. I am closing this issue as wontfix for now.

cako commented 1 year ago

@mrava87 Ruff has made a lot of progress in this year. I've been using it almost exclusively for new projects. It's crazy fast! I think once they close these issues, we should think about migrating to it.

https://github.com/astral-sh/ruff/issues/2402

https://github.com/astral-sh/ruff/issues/5188

mrava87 commented 1 year ago

Sounds like a good plan! I haven't followed much but I trust you, just shout when you think is time :)