-
Install pipenv
-
Install the pre-commit framework
-
Fork and clone the repository
-
Install dev packages and environment
pipenv install --dev --skip-lock
-
Install pre-commit hooks
pre-commit install pre-commit install --hook-type commit-msg
You should be good to go. Verify it is the case by running unit tests. See below.
The GITGUARDIAN_API_KEY
environment variable must be defined to run functional tests. It is also required when recording VCR.py cassettes or updating existing ones.
If you want to run tests against another GitGuardian instance, define the GITGUARDIAN_API_URL
environment variable.
The TEST_KNOWN_SECRET
environment variable must also be defined to run functional tests. It must point to a single-match secret known on the dashboard linked to GITGUARDIAN_API_KEY
.
You can run unit tests with make unittest
.
Run make coverage
. This runs the unit tests through coverage and generates an HTML report in htmlcov/index.html
.
Run make functest
.
Run make lint
to run all configured linters at once.
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Use conventional commit messages, examples:
- feat(integration): Add Azure Pipelines support
- fix(ggshield): add pre-push mode header
We're committed to support python 3.7+ for now.
We use scriv to manage our changelog. It is automatically installed by pipenv install --dev
.
All user-visible changes must be documented in a changelog fragment. You can create one with scriv create
.
The CI rejects any pull request without changelog fragments unless it has been assigned the skip-changelog
label. The skip-changelog
label should only be used if your pull request only contains non-visible changes such as refactors, or fixes for regressions introduced after the latest release.
Before submitting a pull request, make sure that:
- All tests pass
- Linters are happy
- You added a changelog fragment or applied the
skip-changelog
label