ImperialCollegeLondon / paricia

Hydroclimatic data collection and information system
https://imperialcollegelondon.github.io/paricia/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Uses ruff instead of flake8 and isort and update pre-commit hooks #271

Closed dalonsoa closed 3 weeks ago

dalonsoa commented 1 month ago

Modernize the linting and code formatting insfrastructure to match our current standard.

pydocstyle-related codes have been disabled and will be re-enabled when working on the documentation (#258)

mypy configuration is almost identical to that of QwikApp, excluding the same rules, at least for now. Paricia is not heavily typed in many modules.

There are A LOT of files changed, but the meaningful changes can be found by filtering out the last commit, which is when pre-commit is run in all files and fixes to keep ruff and mypy happy are implemented.

dalonsoa commented 1 month ago

Ok, Something I've done has broken the tests. Let's see...

dalonsoa commented 1 month ago

It turns out that ruff removes unused import statements, which is generally good... except when they are required to register functionality. In this case, it had removed the import XXX.signals.handlers that several of the apps require in order register the signal handlers and assign permissions when creating objects. The undone of this change can be seen in https://github.com/ImperialCollegeLondon/paricia/pull/271/commits/7f306857fc94675d845570bc71243811307b585a