Linting and Type Checking
We use ruff for linting our codebase and mypy for type checking.
Autoformatter
Formatting and running our linter is bundled in the make autoformat command.
It is recommended to enable a file watcher in your IDE to automatically
run this command on change.
PyCharm
In Pycharm, this is possible via the File Watchers plugin, using the following
configuration. Depending on your Development Environment there are
different ways to invoke make:
- run
makeon your host machine (needsuvavailable on the path): program
makearguments
autoformat
- run
- run
makein the docker container: command:
dockerarguments
compose --file related/docker/docker-compose.yaml exec -u cdedb app make autoformat
- run
You can also try to run this inside a local vm using ssh.
For all dev setups the same, set the following options:
output paths to refresh:
$FilePath$(This is important because it makes PyCharm apply the changes only to the current file.)working directory:
$ProjectFileDir$