Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding pre-commit actions for local repository editing #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

otherJL0
Copy link

@otherJL0 otherJL0 commented Oct 4, 2021

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

@erezsh
Copy link
Owner

erezsh commented Oct 4, 2021

Thanks! I'll have a look.

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

@otherJL0
Copy link
Author

otherJL0 commented Oct 4, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants