lincc-frameworks / python-project-template

Python project best practices for scientific software
https://lincc-ppt.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
61 stars 15 forks source link

Allow first commit to main #396

Closed camposandro closed 8 months ago

camposandro commented 8 months ago

This pull request solves an inconvenient issue about commits to main. With the current version of the template we install pre-commit hooks on the .prepare_project bash script. One of the hooks protects unintentional commits to main, which is extremely useful during development, but problematic when first creating a repository.

As a workaround, the last stage of the script now includes a commit to the initial branch and for that we skip the "no-commit-to-branch" hook. The documentation was updated accordingly. Closes #331.

Checklist

drewoldag commented 8 months ago

This looks very promising. I'll take a closer look when I'm at my desk.

drewoldag commented 8 months ago

I just ran this locally, and it worked great. Thanks for putting this together!