Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
.pre-commit-config.yaml: Add pre-commit config
Browse files Browse the repository at this point in the history
Add a pre-commit config to the repo to make it easier to run the
relevant formatters and linters which are run in the CI pipeline for
this repo.

This will make it easier to spot linter and formatter errors as the
tooling which runs in the CI pipeline can be run locally in one step.

Signed-off-by: Katie Worton <[email protected]>
  • Loading branch information
katieworton authored and roxell committed May 8, 2024
1 parent 6d3f698 commit 6b28b50
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.0
hooks:
- id: black
files: "^squad-.*|."
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
files: "^squad-.*|."
exclude: "dist/"
args: ["--ignore", "E501,W503"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ To install requirements, from the repo base directory execute:
pip install -r requirements.txt
```

Optional: to install the pre-commit config for this repo, execute:

```
pip install pre-commit
```
Then to have pre-commit run automatically when you commit, run:
```
pre-commit install
```
Alternatively, run pre-commit manually over all files, without it being called
on commit, run:
```
pre-commit run --all-files
```

## Usage

### `squad-list-changes`: Get all of the changes for a build, compared to a base build.
Expand Down

0 comments on commit 6b28b50

Please sign in to comment.