From 7ff56de4c0376f2d04628e8353e6a3394f16f8c0 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sat, 17 Feb 2024 18:36:58 +0100 Subject: [PATCH] refactor(management): start the move to lefthook --- .gitignore | 16 +++++++++++----- .lefthook.yml | 21 +++++++++++++++++++++ .yamllint.yaml | 3 ++- 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 .lefthook.yml diff --git a/.gitignore b/.gitignore index b4daa16..283adf0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,16 @@ .DS_Store -.vscode/* -!.vscode/extensions.json -!.vscode/settings.json +/.vscode/* +!/.vscode/extensions.json +!/.vscode/settings.json + +/.lefthook-local.yml + +/node_modules/ +/package.json +/package-lock.json + +__pycache__/ .obsidian/ @@ -15,5 +23,3 @@ *.tfstate.backup .pulumi/ - -__pycache__/ diff --git a/.lefthook.yml b/.lefthook.yml new file mode 100644 index 0000000..9d13062 --- /dev/null +++ b/.lefthook.yml @@ -0,0 +1,21 @@ +no_tty: true + +lint: + parallel: true + commands: + yamllint: &yamllint + glob: "*.{yaml,yml}" + run: >- + docker run --rm -v "$PWD:/code" 'registry.gitlab.com/pipeline-components/yamllint:latest' + yamllint '.' + +pre-commit: + parallel: true + commands: + yamllint: + <<: *yamllint + +# commit-msg: +# commands: +# commitlint: +# run: commitlint --edit diff --git a/.yamllint.yaml b/.yamllint.yaml index ffa6512..5470e32 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -6,5 +6,6 @@ extends: default rules: line-length: - allow-non-breakable-inline-mappings: true + level: warning max: 120 + allow-non-breakable-inline-mappings: true