NASA-IMPACT / admg-casei

ADMG Inventory
https://impact.earthdata.nasa.gov/casei/
Apache License 2.0
1 stars 0 forks source link

Casei precommit #549

Open naomatheus opened 1 year ago

naomatheus commented 1 year ago

Whoops! Just opening this.

Summary: Adds pre commit config and description and instructions

naomatheus commented 1 year ago

Hey @Tammo-Feldmann I was just seeing your comment on this. Totally makes sense. I know the pre-commit hook will run when you commit, but if you want to run it manually I think you have to setup a virtual environment to be able to run that. But maybe there is a way to do that with JS, or just without a python virtual env.

The other option is don't run to pre-commit on your local machine, but you'll see the linting messages from pre-commit as they're omitted from the .git file scripts and repo. If pre-commit flags something, you won't have committed successfully and can run the linting "manually" without using a python pre-commit.

Tammo-Feldmann commented 1 year ago

@naomatheus I only just saw your comment on this. Thank you for your thoughts and for pushing back. It's always good for me to think this through a bit more. I'm not sure understand why you'd want to run a pre-commit hook manually. Isn't it there to catch those things that we forget to run manually? If there is something you'd like to do before your commits but not every time, wouldn't that best fit into a regular bash script (or even a one liner in the package.json)? I'm not opposed to having such a script or to committing it. Just wondering if that isn't a different purpose and might better stand alone.