Skip to content

Commit fbcbdfe

Browse files
authored
Merge pull request #11 from NHSDigital/feature/eja-eli-96-adding-gitignore-for-pre-commit
Set up repo to allow use of pre-commit (via existing make)
2 parents c21f77b + 94afb1c commit fbcbdfe

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
terraform 1.7.0
44
pre-commit 3.6.0
55
vale 3.6.0
6+
poetry 2.1.1
7+
act 0.2.74
68

79
# ==============================================================================
810
# The section below is reserved for Docker image versions.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ cd nhs-england-tools/repository-template
4646
The following software packages, or their equivalents, are expected to be installed and configured:
4747

4848
- [Docker](https://www.docker.com/) container runtime or a compatible tool, e.g. [Podman](https://podman.io/),
49+
- [asdf](https://asdf-vm.com/) version manager,
4950
- [GNU make](https://www.gnu.org/software/make/) 3.82 or later,
5051

5152
> [!NOTE]<br>
@@ -71,7 +72,7 @@ The following software packages, or their equivalents, are expected to be instal
7172
Installation and configuration of the toolchain dependencies
7273
7374
```shell
74-
$ make install
75+
make install
7576
```
7677
7778
## Usage

scripts/config/pre-commit.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-yaml
9+
- id: detect-aws-credentials
10+
args: [--allow-missing-credentials]
11+
- id: end-of-file-fixer
12+
- id: trailing-whitespace
13+
- id: mixed-line-ending
214
- repo: local
315
hooks:
416
- id: scan-secrets
@@ -38,3 +50,19 @@ repos:
3850
entry: ./scripts/githooks/check-terraform-format.sh
3951
language: script
4052
pass_filenames: false
53+
- repo: https://github.com/astral-sh/ruff-pre-commit
54+
rev: v0.9.7
55+
hooks:
56+
- id: ruff
57+
args: [ --fix ]
58+
- id: ruff-format
59+
- repo: https://github.com/RobertCraigie/pyright-python
60+
rev: v1.1.394
61+
hooks:
62+
- id: pyright
63+
- repo: https://github.com/milin/giticket
64+
rev: v1.3
65+
hooks:
66+
- id: giticket
67+
args: [ '--regex=(?i)ELID-\d+', '--format=[{ticket}] {commit_msg}', '--mode=regex_match' ]
68+
stages: [commit-msg]

0 commit comments

Comments
 (0)