Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[developer] Add and explain pre-commit-hook #100

Open
nemesifier opened this issue Apr 6, 2020 · 3 comments
Open

[developer] Add and explain pre-commit-hook #100

nemesifier opened this issue Apr 6, 2020 · 3 comments

Comments

@nemesifier
Copy link
Member

In the past we had runflake8, runisort scripts all over the repos.

Now we don't have any script but I realize we may need to reintroduce a script for each repo because the flags passed to openwisp-qa-checks are slightly different for each repo.

This way we can have a run-qa-checks script for each repo and we can create pre-commit-hooks that run the script before each commit.

We can put the hook in each repo automatically as well as suggested here: https://stackoverflow.com/questions/3462955/putting-git-hooks-into-repository

The hook could be saved in openwisp-utils. Python packages could install it automatically in the setup.py script, eg:

  • if the current directory is a git repository and if pip install -e . is being called from within the project itself (eg: check the setup.py script and look for something unique in it)
  • then copy the pre-commit-hook from openwisp-utils and install it / symlink it, whatever

For non python packages we can do something similar as all the repos should have some kind of build/install script/procedure (if they don't have one, we must add one).

nemesifier added a commit to openwisp/openwisp-utils that referenced this issue Apr 7, 2020
nemesifier added a commit to openwisp/openwisp-monitoring that referenced this issue Apr 7, 2020
nemesifier added a commit to openwisp/openwisp-users that referenced this issue Apr 7, 2020
pandafy pushed a commit to pandafy/openwisp-monitoring that referenced this issue May 19, 2020
@priyanshuone6
Copy link

Is this issue needed as it is related to this openwisp/openwisp-utils#162?

@purhan
Copy link
Contributor

purhan commented Jan 2, 2021

@priyanshuone6 openwisp/openwisp-utils#162 will add a 'pre-push-hook'. But it also will make it easier to install other hooks, so I'd say we should wait till it is merged before working on this.
Also I guess we should make that PR more generalized in that case.

@praptisharma28
Copy link
Member

Greetings @nemesifier, is this issue still open to work? I want to work upon it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do (documentation)
Development

No branches or pull requests

4 participants