diff options
author | John Westcott IV <32551173+john-westcott-iv@users.noreply.github.com> | 2022-03-24 15:58:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 15:58:14 +0100 |
commit | b9cdd6f2c82ad2ddbb7b49e053abb1aee11af745 (patch) | |
tree | cbfffc9229529f378984bd93cd3def320d73ae4a /CONTRIBUTING.md | |
parent | Merge pull request #11941 from shanemcd/update-devel-image-refs (diff) | |
download | awx-b9cdd6f2c82ad2ddbb7b49e053abb1aee11af745.tar.xz awx-b9cdd6f2c82ad2ddbb7b49e053abb1aee11af745.zip |
Adding ability to run user level pre-commit hooks (#11923)
* Adding ability to run user level pre-commit hooks
* Adding pre-commit docs in CONTRIBUTING.md
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 57c2d79f21..535fb0db66 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,6 +17,7 @@ Have questions about this document or anything not covered here? Come chat with - [Building API Documentation](#building-api-documentation) - [Accessing the AWX web interface](#accessing-the-awx-web-interface) - [Purging containers and images](#purging-containers-and-images) + - [Pre commit hooks](#pre-commit-hooks) - [What should I work on?](#what-should-i-work-on) - [Submitting Pull Requests](#submitting-pull-requests) - [PR Checks run by Zuul](#pr-checks-run-by-zuul) @@ -104,6 +105,14 @@ When necessary, remove any AWX containers and images by running the following: (host)$ make docker-clean ``` +### Pre commit hooks + +When you attempt to perform a `git commit` there will be a pre-commit hook that gets run before the commit is allowed to your local repository. For example, python's [black](https://pypi.org/project/black/) will be run to test the formatting of any python files. + +While you can use environment variables to skip the pre-commit hooks GitHub will run similar tests and prevent merging of PRs if the tests do not pass. + + If you would like to add additional commit hooks for your own usage you can create a directory in the root of the repository called `pre-commit-user`. Any executable file in that directory will be executed as part of the pre-commit hooks. If any of the pre-commit checks fail the commit will be halted. For your convenience in user scripts, a variable called `CHANGED_FILES` will be set with any changed files present in the commit. + ## What should I work on? For feature work, take a look at the current [Enhancements](https://github.com/ansible/awx/issues?q=is%3Aissue+is%3Aopen+label%3Atype%3Aenhancement). |