diff --git a/.gitignore b/.gitignore index a123252..5f034ab 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ !/.vscode/extensions.json !/.vscode/settings.json +/.lefthook/ /.lefthook-local.yml /node_modules/ diff --git a/.lefthook.yml b/.lefthook.yml index d95ae7b..b47836c 100644 --- a/.lefthook.yml +++ b/.lefthook.yml @@ -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 diff --git a/.vscode/settings.json b/.vscode/settings.json index 5aaefbd..7145940 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -58,7 +58,7 @@ "[yaml]": { "editor.rulers": [ 120 - ], + ] }, "cSpell.language": "en,en-GB", diff --git a/Makefile b/Makefile index fde5fcf..506bef9 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/examples/dotfiles/.config/zed/settings.json b/examples/dotfiles/.config/zed/settings.jsonc similarity index 68% rename from examples/dotfiles/.config/zed/settings.json rename to examples/dotfiles/.config/zed/settings.jsonc index 8ef30c3..488677c 100644 --- a/examples/dotfiles/.config/zed/settings.json +++ b/examples/dotfiles/.config/zed/settings.jsonc @@ -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 } -} +} \ No newline at end of file diff --git a/package.json b/package.json index bf29ead..a968875 100644 --- a/package.json +++ b/package.json @@ -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" + } } diff --git a/requirements.txt b/requirements.txt index f611a27..d1acb6e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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