chore: improve lefthook configuration

This commit is contained in:
Michele Cereda
2024-07-14 00:18:07 +02:00
parent 71b64b3962
commit 9fdb9f1b0a
7 changed files with 29 additions and 23 deletions

1
.gitignore vendored
View File

@@ -4,6 +4,7 @@
!/.vscode/extensions.json
!/.vscode/settings.json
/.lefthook/
/.lefthook-local.yml
/node_modules/

View File

@@ -6,6 +6,14 @@ skip_output:
- skips
bootstrap:
parallel: true
commands:
commitlint:
run: npm install --save-dev '@commitlint/cli' '@commitlint/config-conventional'
venv:
run: make create-venv
debug:
parallel: true
commands:
@@ -13,14 +21,6 @@ debug:
glob: '.commitlintrc.js'
run: node_modules/.bin/commitlint --print-config
pre-flight:
parallel: true
commands:
commitlint:
run: npm install --save-dev '@commitlint/cli' '@commitlint/config-conventional'
venv:
run: make recreate-venv
lint:
parallel: true
@@ -69,7 +69,7 @@ validate:
glob: '*.{yaml,yml}'
run: >-
echo '{all_files}'
| xargs -t yq '.'
| xargs -t .venv/bin/yq '.'
pre-commit:
@@ -81,7 +81,7 @@ pre-commit:
validate-yaml:
<<: *yq
run: >-
yq '.' {staged_files} > /dev/null
.venv/bin/yq '.' {staged_files} > /dev/null
&& echo 'All YAML files are readable'
validate-ansible-playbooks:
<<: *ansible-playbook-syntax-check

View File

@@ -58,7 +58,7 @@
"[yaml]": {
"editor.rulers": [
120
],
]
},
"cSpell.language": "en,en-GB",

View File

@@ -2,13 +2,14 @@
override venv ?= ${shell git rev-parse --show-toplevel}/.venv
create-venv: override python_version ?= 3
create-venv: ${shell which 'python${python_version}'}
@python${python_version} -m 'venv' '${venv}'
create-venv: override python_version ?= 3.11
create-venv: override python_executable ?= ${shell which --tty-only --show-dot --show-tilde 'python${python_version}'}
create-venv: ${python_executable}
@${python_executable} -m 'venv' '${venv}'
@${venv}/bin/pip --require-virtualenv install -r 'requirements.txt'
recreate-venv:
@rm -r '${venv}'
@rm -rf '${venv}'
@${MAKE} create-venv
update-venv: ${venv}/bin/pip

View File

@@ -1,7 +1,10 @@
// Zed settings
//
// ** This file extension must be 'json', not 'jsonc'. **
// ** Only named with .jsonc to skip validation in the repo.
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
// documentation: https://zed.dev/docs/configuring-zed.
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
@@ -12,4 +15,4 @@
"features": {
"inline_completion_provider": "none" // Disable copilot
}
}
}

View File

@@ -1,6 +1,6 @@
{
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2"
}
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2"
}
}

View File

@@ -1,4 +1,5 @@
ansible==9.5.1
ansible-lint==24.2.2
ansible==10.1.0
ansible-lint==24.7.0
click==8.1.7
pyinilint==0.17
yq==3.4.3