From 3fa0d39d43af2d39b860ba8df954cd62a8c833c5 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 30 Nov 2025 21:38:59 +1100 Subject: [PATCH] feat: add pre-commit - test yamllint - test ruff linting/formatter - fix yaml errors --- .pre-commit-config.yaml | 19 +++++++++++++++++++ rpms/helmfile/resources/nfpm.yaml | 3 ++- .../resources/nfpm.yaml | 3 ++- rpms/jsonnet-lint/resources/nfpm.yaml | 3 ++- rpms/jsonnet/resources/nfpm.yaml | 3 ++- rpms/libfoundationdb/resources/nfpm.yaml | 3 ++- .../resources/nfpm.yaml | 3 ++- .../resources/nfpm.yaml | 3 ++- rpms/openbao-plugins/resources/nfpm.yaml | 3 ++- rpms/stalwart/resources/nfpm.yaml | 3 ++- rpms/tflint/resources/nfpm.yaml | 3 ++- rpms/vals/resources/nfpm.yaml | 3 ++- 12 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..27c11a9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +--- +repos: + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.37.1 + hooks: + - id: yamllint + args: + [ + "-d {extends: relaxed, rules: {line-length: disable}}", + "-s", + ] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.7 + hooks: + # Run the linter. + - id: ruff-check + args: [--fix] + # Run the formatter. + - id: ruff-format diff --git a/rpms/helmfile/resources/nfpm.yaml b/rpms/helmfile/resources/nfpm.yaml index cc61880..f6cf60e 100644 --- a/rpms/helmfile/resources/nfpm.yaml +++ b/rpms/helmfile/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -35,4 +36,4 @@ contents: # preinstall: ./scripts/preinstall.sh # postinstall: ./scripts/postinstall.sh # preremove: ./scripts/preremove.sh -# postremove: ./scripts/postremove.sh \ No newline at end of file +# postremove: ./scripts/postremove.sh diff --git a/rpms/jsonnet-language-server/resources/nfpm.yaml b/rpms/jsonnet-language-server/resources/nfpm.yaml index e492cf8..aef6894 100644 --- a/rpms/jsonnet-language-server/resources/nfpm.yaml +++ b/rpms/jsonnet-language-server/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -35,4 +36,4 @@ contents: # preinstall: ./scripts/preinstall.sh # postinstall: ./scripts/postinstall.sh # preremove: ./scripts/preremove.sh -# postremove: ./scripts/postremove.sh \ No newline at end of file +# postremove: ./scripts/postremove.sh diff --git a/rpms/jsonnet-lint/resources/nfpm.yaml b/rpms/jsonnet-lint/resources/nfpm.yaml index 7042f5c..e7e8c10 100644 --- a/rpms/jsonnet-lint/resources/nfpm.yaml +++ b/rpms/jsonnet-lint/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -27,4 +28,4 @@ contents: file_info: mode: 0755 owner: root - group: root \ No newline at end of file + group: root diff --git a/rpms/jsonnet/resources/nfpm.yaml b/rpms/jsonnet/resources/nfpm.yaml index 1ac45ba..cda3663 100644 --- a/rpms/jsonnet/resources/nfpm.yaml +++ b/rpms/jsonnet/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -33,4 +34,4 @@ contents: file_info: mode: 0755 owner: root - group: root \ No newline at end of file + group: root diff --git a/rpms/libfoundationdb/resources/nfpm.yaml b/rpms/libfoundationdb/resources/nfpm.yaml index 07c69b5..8197179 100644 --- a/rpms/libfoundationdb/resources/nfpm.yaml +++ b/rpms/libfoundationdb/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -33,4 +34,4 @@ contents: # Scripts to run during installation/removal scripts: - postinstall: /app/resources/scripts/postinstall.sh \ No newline at end of file + postinstall: /app/resources/scripts/postinstall.sh diff --git a/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml b/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml index c7be86f..07a8822 100644 --- a/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml +++ b/rpms/openbao-plugin-secret-consul/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -32,4 +33,4 @@ contents: # Scripts to run during installation/removal scripts: - preinstall: /app/resources/scripts/preinstall.sh \ No newline at end of file + preinstall: /app/resources/scripts/preinstall.sh diff --git a/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml b/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml index 96a8102..ebbed81 100644 --- a/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml +++ b/rpms/openbao-plugin-secret-nomad/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -32,4 +33,4 @@ contents: # Scripts to run during installation/removal scripts: - preinstall: /app/resources/scripts/preinstall.sh \ No newline at end of file + preinstall: /app/resources/scripts/preinstall.sh diff --git a/rpms/openbao-plugins/resources/nfpm.yaml b/rpms/openbao-plugins/resources/nfpm.yaml index 89649bc..fdea760 100644 --- a/rpms/openbao-plugins/resources/nfpm.yaml +++ b/rpms/openbao-plugins/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -27,4 +28,4 @@ depends: - openbao-plugin-secret-nomad # No actual files in this meta package -contents: [] \ No newline at end of file +contents: [] diff --git a/rpms/stalwart/resources/nfpm.yaml b/rpms/stalwart/resources/nfpm.yaml index 4990c02..dea09ee 100644 --- a/rpms/stalwart/resources/nfpm.yaml +++ b/rpms/stalwart/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -44,4 +45,4 @@ scripts: preinstall: /app/resources/scripts/preinstall.sh postinstall: /app/resources/scripts/postinstall.sh preremove: /app/resources/scripts/preremove.sh - postremove: /app/resources/scripts/postremove.sh \ No newline at end of file + postremove: /app/resources/scripts/postremove.sh diff --git a/rpms/tflint/resources/nfpm.yaml b/rpms/tflint/resources/nfpm.yaml index 253d8cb..4c5d12f 100644 --- a/rpms/tflint/resources/nfpm.yaml +++ b/rpms/tflint/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -35,4 +36,4 @@ contents: # preinstall: ./scripts/preinstall.sh # postinstall: ./scripts/postinstall.sh # preremove: ./scripts/preremove.sh -# postremove: ./scripts/postremove.sh \ No newline at end of file +# postremove: ./scripts/postremove.sh diff --git a/rpms/vals/resources/nfpm.yaml b/rpms/vals/resources/nfpm.yaml index 101772b..839739e 100644 --- a/rpms/vals/resources/nfpm.yaml +++ b/rpms/vals/resources/nfpm.yaml @@ -1,3 +1,4 @@ +--- # nfpm.yaml name: ${PACKAGE_NAME} @@ -35,4 +36,4 @@ contents: # preinstall: ./scripts/preinstall.sh # postinstall: ./scripts/postinstall.sh # preremove: ./scripts/preremove.sh -# postremove: ./scripts/postremove.sh \ No newline at end of file +# postremove: ./scripts/postremove.sh