giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.32k stars 1.39k forks source link

Add ruff Python linter, remove flake8 #2312

Closed giampaolo closed 1 year ago

giampaolo commented 1 year ago

See: https://blog.jerrycodes.com/ruff-the-python-linter/. Advantages:

1) an order of magnitude faster than flake8 + isort (0.1 secs instead of 2.5 secs to lint all .py files):

Before:

$ time make flake8 isort 
real    0m2,554s
user    0m15,626s
sys 0m0,436s

Now:

$ time make ruff 
real    0m0,102s
user    0m0,297s
sys 0m0,025s

2) A lot more code quality checks than before.

Previously done also for pyftpdlib: https://github.com/giampaolo/pyftpdlib/pull/611.