Preql icon indicating copy to clipboard operation
Preql copied to clipboard

Adding pre-commit actions for local repository editing

Open otherJL0 opened this issue 2 years ago • 2 comments

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 and black on preql/ files only when a local commit is attempted
    • If files are already formatted by isort and black, the commit succeeds
    • If the files need to be formatted by isort and black, the files are formatted by both tools and the commit fails. Commiting again should result in no issues.
  • Run minimal tests when a push is attempted

otherJL0 avatar Oct 04 '21 15:10 otherJL0

Thanks! I'll have a look.

Are you submitting it because you found the code hard to read?

erezsh avatar Oct 04 '21 16:10 erezsh

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).

otherJL0 avatar Oct 04 '21 17:10 otherJL0