Skip to content
Snippets Groups Projects
Commit 8ee9b742 authored by Mark's avatar Mark
Browse files

Merge branch '705-add-pre-commit-checks-to-the-repo' into 'master'

Resolve "Add pre-commit checks to the repo"

Closes #705

See merge request openappstack/openappstack!370
parents 20c2be30 0a8c6384
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
......@@ -18,3 +19,13 @@ repos:
rev: v1.23.0
hooks:
- id: hadolint
- repo: https://github.com/jazzband/pip-tools
# Makes sure the requirements.txt file is up to date
rev: 5.2.1
hooks:
- id: pip-compile
- repo: https://github.com/timothycrosley/isort
# Sorts import statements for you
rev: 5.0.9
hooks:
- id: isort
# How to contribute
## Preparing the development environment
Make sure you have development dependencies installed in your development environment.
```
pip install -r requirements-dev.txt
```
## pre-commit hooks
We use [pre-commit](https://pre-commit.com/) to maintain and install pre-commit
hooks that should be executed before each commit.
Please install these required tools on your system:
* [hadolint](https://github.com/hadolint/hadolint) for linting the `Dockerfile`
* [shellcheck](https://www.shellcheck.net/) and
* [shfmt](https://github.com/mvdan/sh) to lint and validate shell scripts
Then install pre-commit hooks:
```
pre-commit install
```
Running `git commmit` for the first time after installing the hook usually takes a
little longer because `pre-commit` pulls it's hooks from upstream repositories.
You can find all hooks in `.pre-commit-config.yaml`.
In case you need to skip the execution of the pre-commit hooks (please don't!),
use `git commit --no-verify`.
## Adding dependencies
Make sure you update our `requirements.txt` file before you push your changes.
Whenever you need a new python package, add it to requirements.in and run
`pip-compile`
to generate an new `requirements.txt` which does not only pin the new package
but also its dependencies.
If the new package you are adding is only used by developers,
please add it to the `requirements-dev.txt` file.
# Add development requirements here
# Please pin releases manually if necessary
pip-tools
pre-commit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment