Since the repo is being modernized, I figured I would direct some attention to ruff, a single tool that replaces a huge portion of the python ecosystem's linting and auto-upgrade tools, while running 10-100x faster than most of them due to it being written in Rust.
I took the liberty of replacing pylint with ruff's equivalent rule PL, and enabled a bunch of optional rules for upgrading to modern python syntaxes (namely isort, pyupgrade, flake8-comprehensions, flake8-pie, flake8-simplify, pylint, and ruff's own ruleset). Their list of rules keeps growing, and you can enable more of them in pyproject.toml.
They don't (yet) reimplement black, so I disabled ruff's line-length complaint and let black handle it in the Makefile lint script.
Besides the 33 auto-fixed rule violations, there are 6 PL suggestions that probably don't need attention, but the line containing F811 Redefinition looks very important.
(gkeepapi) ~/gkeepapi>$ make
ruff --fix src
src/gkeepapi/__init__.py:234:33: PLR2004 Magic value used in comparison, consider replacing 401 with a constant variable
src/gkeepapi/__init__.py:621:9: F811 Redefinition of unused `update` from line 466
src/gkeepapi/__init__.py:676:9: PLR0913 Too many arguments to function call (6 > 5)
src/gkeepapi/__init__.py:703:9: PLR0913 Too many arguments to function call (6 > 5)
src/gkeepapi/__init__.py:815:9: PLR0913 Too many arguments to function call (8 > 5)
src/gkeepapi/__init__.py:1096:9: PLR0912 Too many branches (17 > 12)
Found 6 errors.
make: [Makefile:4: lint] Error 1 (ignored)
black src
All done! ✨ 🍰 ✨
3 files left unchanged.
Thanks, I've been meaning to check out ruff! Learned a couple of things going thru the diff. I'll take a closer look at ruff's rulesets to see if there's any others worth enabling.
Since the repo is being modernized, I figured I would direct some attention to ruff, a single tool that replaces a huge portion of the python ecosystem's linting and auto-upgrade tools, while running 10-100x faster than most of them due to it being written in Rust.
I took the liberty of replacing
pylint
with ruff's equivalent rulePL
, and enabled a bunch of optional rules for upgrading to modern python syntaxes (namelyisort
,pyupgrade
,flake8-comprehensions
,flake8-pie
,flake8-simplify
,pylint
, andruff
's own ruleset). Their list of rules keeps growing, and you can enable more of them inpyproject.toml
.They don't (yet) reimplement
black
, so I disabled ruff's line-length complaint and let black handle it in theMakefile
lint script.Besides the 33 auto-fixed rule violations, there are 6
PL
suggestions that probably don't need attention, but the line containingF811 Redefinition
looks very important.