pgh-public-meetings / city-scrapers-pitt

Pittsburgh City Scrapers: sourcing public meetings in Pittsburgh
https://pgh-public-meetings.github.io/events/
MIT License
19 stars 66 forks source link

Add pre-commit hook for black #176

Open ben-nathanson opened 3 years ago

ben-nathanson commented 3 years ago

Rather than having to remember to run black . the consensus from tonight's meeting was that it would be great to have this as a pre-commit hook. I will work on an implementation to explore the idea.

ben-nathanson commented 3 years ago

Normally, git hooks are not tracked. This means we couldn't put them in source control directly.

  1. We could create a hooks directory and have every contributor manually configure their git hook path to the hooks directory. This would be a one-time step. If we want to avoid that, we could extend the documentation to include a step to this hook in the setup flow.

  2. We could use pre-commit, a library for Python3 which should do this automatically.

I'll bring this back to the next meeting and see what folks think.

Further reading

Even more reading