ManderaGeneral / generalpackager

Tools to interface GitHub, PyPI, NPM and local modules / repos. Used for generating files to keep projects dry and synced. Tailored for ManderaGeneral for now.
https://pypi.org/project/generalpackager/
Apache License 2.0
0 stars 0 forks source link

Git hooks for contributors #80

Open Mandera opened 1 year ago

Mandera commented 1 year ago

Since the .git folder isn't versioned for security reasons to execute arbitrary code we have an issue; pre-commit and pre-push hooks won't be there when forked or cloned.

Options

I don't want developers to have to write pre-commit install. Everything should go through generate.py - I like it especially because it's very transparent for devs to look through the python code before running the file

Mandera commented 1 year ago

Might not be such a good idea to have generate.py to setup the dev environment, because it would require generalpackager to be installed. Although I guess generalpackager could be put in every repos [dev] dependencies. Having circular dependency through the optional [dev] might be fine. These dev deps should be ignored by the mermaid graph too

generate.py is just something I made because I got tired of generating the workflow by hand, then it turned out to be pretty useful to keep git hooks in sync as well. Also nice to make sure the readme has been generated properly

It's basically what happens in the sync stage of the workflow as well. Running it once will enable the pre-push hook to run it automatically, but only important (non-aesthetic) files

To summarize, generate_localfiles is used in a few places:

The linting should probably be included in all of these places