Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • serfort/pre-commit_template
1 result
Show changes
Commits on Source (2)
......@@ -18,7 +18,7 @@ python_style:
- |
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
pip -q install -r requirements.txt
pre-commit run --all-files &> >(tee pre-commit.log)
artifacts:
when: on_failure
......
# pre-commit_template
---
title: pre-commit Template
author: Sebastian Erfort
---
# pre-commit Template
Template and reference for the [pre-commit framework](https://pre-commit.com).
## Getting started
......@@ -17,13 +24,13 @@
3. follow steps from [pre-commit Quick start guide](https://pre-commit.com/#quick-start) to set it up and run it
1. [add/edit pre-commit configuration](https://pre-commit.com/#2-add-a-pre-commit-configuration), for example Python code formatter [Black](https://github.com/psf/black) (notice the authors advise to use the mirror repo [black-pre-commit-mirror](https://github.com/psf/black-pre-commit-mirror))
2. install Git hook scripts
2. install Git hook scripts to automate running
```bash
pre-commit install
```
This creates a Git pre-commit hook that installs and runs pre-commit for other users of this repository as well.
This does not affect other clones of the repository, the hooks have to be installed there again.
3. run against files
......@@ -31,3 +38,4 @@
pre-commit run --all-files
```
The script `setup.sh` performs steps 1. - 3.2.
#!/usr/bin/env bash
python -m venv .venv
. .venv/bin/activate
pip -q install -r requirements.txt
pre-commit install
pre-commit --version