diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d607cbc1360d67bf228a0e745450ecdf90e870f0..4a77a3e8255d6e8ca6f17948db649c24428596a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/README.md b/README.md index 31c8d9bd0189421316ef57fb19141db54cf6543a..e651aab6943f6b0d1fb83e141c7b8b8cd02deec7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -# 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,15 +24,18 @@ 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 does not affect other clones of the repository, the hooks have to be installed there again. + 3. run against files ```bash pre-commit run --all-files ``` +The script `setup.sh` performs steps 1. - 3.2. diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e1d8a6ba4fcfb1e54f312d10f97a109c7ef353ed --- /dev/null +++ b/setup.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +python -m venv .venv +. .venv/bin/activate +pip -q install -r requirements.txt +pre-commit install +pre-commit --version