Skip to content
Snippets Groups Projects
Commit ee8f63c0 authored by SErfort's avatar SErfort :thinking:
Browse files

add setup script | upd README

parent fed7a1b7
No related branches found
No related tags found
No related merge requests found
......@@ -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,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.
#!/usr/bin/env bash
python -m venv .venv
. .venv/bin/activate
pip -q install -r requirements.txt
pre-commit install
pre-commit --version
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