From 57339c7cc5c8602e324bb429bf755f71c5f8fc8a Mon Sep 17 00:00:00 2001 From: Edd Almond Date: Fri, 21 Feb 2025 11:49:49 +0000 Subject: [PATCH 1/4] ELI-78 - adding .pre-commit-config.yaml to gitignore so that devs that want to use it don't have to worry about accidentally commiting it --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ed6dd326..c8e632e4 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ newman/ .idea .DS_Store .#* +.pre-commit-config.yaml __pycache__/ .envrc From 3137438947b2b4f5d8e7946351b11f77f81ebbaf Mon Sep 17 00:00:00 2001 From: Edd Almond Date: Fri, 21 Feb 2025 14:15:29 +0000 Subject: [PATCH 2/4] eli-96 adding poetry and act to .tool-versions, and updating readme, so we can use asdf + existing repo make for pre-commit --- .tool-versions | 2 ++ README.md | 1 + 2 files changed, 3 insertions(+) diff --git a/.tool-versions b/.tool-versions index 0c02acd7..f4e08985 100644 --- a/.tool-versions +++ b/.tool-versions @@ -3,6 +3,8 @@ terraform 1.7.0 pre-commit 3.6.0 vale 3.6.0 +poetry 2.1.1 +act 0.2.74 # ============================================================================== # The section below is reserved for Docker image versions. diff --git a/README.md b/README.md index b7c1302f..4393883a 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ cd nhs-england-tools/repository-template The following software packages, or their equivalents, are expected to be installed and configured: - [Docker](https://www.docker.com/) container runtime or a compatible tool, e.g. [Podman](https://podman.io/), +- [asdf](https://asdf-vm.com/) version manager, - [GNU make](https://www.gnu.org/software/make/) 3.82 or later, > [!NOTE]
From 1f5d7b549e18790c4d82e9cc3b77cbf7954e3aad Mon Sep 17 00:00:00 2001 From: Edd Almond Date: Fri, 21 Feb 2025 14:22:28 +0000 Subject: [PATCH 3/4] eli-96 updating repo pre-commit template with additional hooks for ruff and pyright, as well as basic checks --- .gitignore | 1 - scripts/config/pre-commit.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c8e632e4..ed6dd326 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ newman/ .idea .DS_Store .#* -.pre-commit-config.yaml __pycache__/ .envrc diff --git a/scripts/config/pre-commit.yaml b/scripts/config/pre-commit.yaml index 37ca6375..73a62de2 100644 --- a/scripts/config/pre-commit.yaml +++ b/scripts/config/pre-commit.yaml @@ -1,4 +1,16 @@ repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-yaml + - id: detect-aws-credentials + args: [--allow-missing-credentials] + - id: end-of-file-fixer + - id: trailing-whitespace + - id: mixed-line-ending - repo: local hooks: - id: scan-secrets @@ -38,3 +50,19 @@ repos: entry: ./scripts/githooks/check-terraform-format.sh language: script pass_filenames: false +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.7 + hooks: + - id: ruff + args: [ --fix ] + - id: ruff-format +- repo: https://github.com/RobertCraigie/pyright-python + rev: v1.1.394 + hooks: + - id: pyright +- repo: https://github.com/milin/giticket + rev: v1.3 + hooks: + - id: giticket + args: [ '--regex=(?i)ELID-\d+', '--format=[{ticket}] {commit_msg}', '--mode=regex_match' ] + stages: [commit-msg] From 94afb1cd855c26a8b3d81a7e36666aa00ab87428 Mon Sep 17 00:00:00 2001 From: Edd Almond Date: Fri, 21 Feb 2025 14:32:02 +0000 Subject: [PATCH 4/4] eli-96 fixing markdown linting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4393883a..50443932 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ The following software packages, or their equivalents, are expected to be instal Installation and configuration of the toolchain dependencies ```shell -$ make install +make install ``` ## Usage