Preql
Preql copied to clipboard
Adding pre-commit actions for local repository editing
To streamline local development, several developer tools were added to the pyproject.toml dev-dependencies
section:
pre-commit isort black pylint
Pre-commit is not triggered by default and must be enabled with the following command:
poetry run pre-commit install
Pre-commit has been configured to:
- Run
isort
andblack
onpreql/
files only when a local commit is attempted- If files are already formatted by
isort
andblack
, the commit succeeds - If the files need to be formatted by
isort
andblack
, the files are formatted by both tools and the commit fails. Commiting again should result in no issues.
- If files are already formatted by
- Run minimal tests when a push is attempted
Thanks! I'll have a look.
Are you submitting it because you found the code hard to read?
Hey! Not at all, I just like offloading some of the less interesting stuff when working on projects (ie styling, formatting). I've had the chance to set up this kind of local workflow on poetry projects before and I've really enjoyed the results. Right now it's only adding formatting tools but it would be straightforward to include mypy
for type checking and linting (currently off, but can be enabled later).