Closed xmnlab closed 4 years ago
I think this is cool! However I think we should definitely document all of this before exposing configuration options to folks. Could we add documentation for these to the dev guide so people know what they mean?
thanks for the feedback @choldgraf ! that makes a lot of sense. I will work on that!
I also was thinking that maybe would be good to test the pre-commit hook itself. to avoid to add a recipe if some bug. but I didn't find yet a good approach. any thought?
@choldgraf I opened a PR to add some information about git pre-commit hook into dev_guide: https://github.com/pyOpenSci/dev_guide/pull/57
re: tests, I think we could add a test that includes running pre-commit and checks whether there is a diff. I've used something like this in other projects (with github-actions):
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[code_style]
- name: Run pre-commit
run: |
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
@choldgraf sounds good! I will work on that! thanks!
@choldgraf I added the test for github actions, but as I am not a collaborator for this repo, it was not triggered.
should I move it to travis-ci?
it seems that the github action was triggered .. but not listed here
Huh - that's weird, I'd have thought you could do this since you're a member of the POS organization. I just added you as a maintainer to this repo, can you try again?
thanks @choldgraf ! I cannot see the new actions here or in the previous list I receive the error: https://github.com/OpenScienceLabs/cookiecutter-pyopensci/actions
not sure what I am missing here .. should I create a workflow first direct in the actions tab?
hmmm, maybe it needs to be merged first before it'll work. Is this ready to merge otherwise? Then we can spot-check github actions in another PR?
I tested it locally ... so I think it is ready to merge! thanks! I will check in another PR the github actions.
sounds good! thanks for making this contribution @xmnlab :-)
thank you @choldgraf for all the recommendations and tips!
it seems the github actions worked: https://github.com/pyOpenSci/cookiecutter-pyopensci/runs/696767222?check_suite_focus=true
Resolve #15
This PR adds some pre commit hooks options:
pre-commit-hooks are very useful to check code before commit.
let me know if these options are useful to pyopensci :)