From cd6aeba2fd5933b9641ccc917da4d8dbf9d75cf9 Mon Sep 17 00:00:00 2001 From: Niall Byrne <9848926+niall-byrne@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:03:13 -0500 Subject: [PATCH] ci(PRE-COMMIT): update to latest, update vale config --- .github/scripts/job-50-test-precommit.sh | 1 + .github/workflows/workflow-cookiecutter-template.yml | 1 + .github/workflows/workflow-meta_tests.yml | 1 + .gitignore | 2 ++ .pre-commit-config.yaml | 3 ++- .vale.ini | 10 +++++++++- README.md | 4 +++- scripts/install-cookiecutter.sh | 8 ++++++-- scripts/install-poetry.sh | 2 ++ .../.github/scripts/job-50-test-precommit.sh | 1 + .../.github/workflows/workflow-push.yml | 2 ++ {{cookiecutter.project_slug}}/.gitignore | 2 ++ .../.pre-commit-config.yaml | 3 ++- {{cookiecutter.project_slug}}/.vale.ini | 12 +++++++++--- .../Vocab/{{cookiecutter.project_slug}}/accept.txt | 1 + 15 files changed, 44 insertions(+), 9 deletions(-) diff --git a/.github/scripts/job-50-test-precommit.sh b/.github/scripts/job-50-test-precommit.sh index e25fba7f..3a6e6cb4 100755 --- a/.github/scripts/job-50-test-precommit.sh +++ b/.github/scripts/job-50-test-precommit.sh @@ -135,6 +135,7 @@ util() { main() { pushd "${TEST_PROJECT_NAME}" >> /dev/null + poetry run pre-commit run --hook-stage manual spelling-vale-synchronize scenario "${1}" popd >> /dev/null diff --git a/.github/workflows/workflow-cookiecutter-template.yml b/.github/workflows/workflow-cookiecutter-template.yml index 98ea9826..52f83299 100644 --- a/.github/workflows/workflow-cookiecutter-template.yml +++ b/.github/workflows/workflow-cookiecutter-template.yml @@ -97,6 +97,7 @@ jobs: COMMAND: | CICD_COMMIT_MESSAGES_FILE="$(mktemp XXXXXXXX.git_history_file)" git log --pretty=format:%s "${PUSHED_COMMIT_REV_RANGE}" > "${CICD_COMMIT_MESSAGES_FILE}" + poetry run pre-commit run --hook-stage manual spelling-vale-synchronize poetry run pre-commit run --hook-stage commit-msg spelling-commit-message --commit-msg-filename "${CICD_COMMIT_MESSAGES_FILE}" COMMAND_NAME: "Commit Message Spelling" CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.COOKIECUTTER_CONFIGURATION)._GITHUB_CI_DEFAULT_CONCURRENCY }} diff --git a/.github/workflows/workflow-meta_tests.yml b/.github/workflows/workflow-meta_tests.yml index 7889ee46..3e9ffb34 100644 --- a/.github/workflows/workflow-meta_tests.yml +++ b/.github/workflows/workflow-meta_tests.yml @@ -230,6 +230,7 @@ jobs: COMMAND: | CICD_COMMIT_MESSAGES_FILE="$(mktemp XXXXXXXX.git_history_file)" git log --pretty=format:%s "${PUSHED_COMMIT_REV_RANGE}" > "${CICD_COMMIT_MESSAGES_FILE}" + poetry run pre-commit run --hook-stage manual spelling-vale-synchronize poetry run pre-commit run --hook-stage commit-msg spelling-commit-message --commit-msg-filename "${CICD_COMMIT_MESSAGES_FILE}" COMMAND_NAME: "Commit Message Spelling" CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.COOKIECUTTER_CONFIGURATION)._GITHUB_CI_DEFAULT_CONCURRENCY }} diff --git a/.gitignore b/.gitignore index 80a36dee..da6b2658 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,7 @@ !.cicd-tools/boxes/bootstrap .cicd-tools/manifest.json .cicd-tools/manifest.json.asc +.vale +!.vale/Vocab poetry.lock node_modules/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d4b41d9..d8cc2672 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: commitizen stages: [commit-msg] - repo: https://github.com/cicd-tools-org/pre-commit.git - rev: 0.3.0 + rev: 0.4.0 hooks: - id: format-shell args: @@ -53,6 +53,7 @@ repos: - id: spelling-commit-message - id: spelling-markdown exclude: "^{{cookiecutter\\.project_slug}}/.+$" + - id: spelling-vale-synchronize - repo: https://github.com/adrienverge/yamllint.git rev: v1.32.0 hooks: diff --git a/.vale.ini b/.vale.ini index 63dbfd0d..c27f5625 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,10 +1,18 @@ StylesPath = ".vale" Vocab = "cicd-tools" +MinAlertLevel = suggestion + +Packages = proselint, alex, \ +https://github.com/cicd-tools-org/vale/releases/download/0.1.0/cicd-tools.zip [*] BasedOnStyles = Vale +cicd-tools.PythonProject = YES Vale.Terms = NO +Vale.Spelling = NO [*.md] -BasedOnStyles = Vale +BasedOnStyles = proselint, alex, Vale +cicd-tools.PythonProject = YES Vale.Terms = YES +Vale.Spelling = NO diff --git a/README.md b/README.md index fcb8ccde..ed57a4f1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ Managed, Centralized CI/CD Components. A platform in a repository. -#### Master Branch (Please consume this branch.) + +## Master Branch Builds + - [![workflow-link](https://github.com/cicd-tools-org/cicd-tools/actions/workflows/workflow-ansible-role-molecule.yml/badge.svg?branch=master)](https://github.com/cicd-tools-org/cicd-tools/actions/workflows/workflow-ansible-role-molecule.yml) - [![workflow-link](https://github.com/cicd-tools-org/cicd-tools/actions/workflows/workflow-compose-command.yml/badge.svg?branch=master)](https://github.com/cicd-tools-org/cicd-tools/actions/workflows/workflow-compose-command.yml) - [![workflow-link](https://github.com/cicd-tools-org/cicd-tools/actions/workflows/workflow-container-multiarch.yml/badge.svg?branch=master)](https://github.com/cicd-tools-org/cicd-tools/actions/workflows/workflow-container-multiarch.yml) diff --git a/scripts/install-cookiecutter.sh b/scripts/install-cookiecutter.sh index 1c32e6c4..3caaa3c3 100755 --- a/scripts/install-cookiecutter.sh +++ b/scripts/install-cookiecutter.sh @@ -28,10 +28,14 @@ main() { _installer_actions _installer_cookiecutter_symlinks - _installer_line_in_file ".gitignore" '.cicd-tools/boxes/*' + _installer_line_in_file ".gitignore" '.cicd-tools/boxes' _installer_line_in_file ".gitignore" '!.cicd-tools/boxes/bootstrap' - _installer_line_in_file "{{cookiecutter.project_slug}}/.gitignore" '.cicd-tools/boxes/*' + _installer_line_in_file ".gitignore" '.vale' + _installer_line_in_file ".gitignore" '!.vale/Vocab' + _installer_line_in_file "{{cookiecutter.project_slug}}/.gitignore" '.cicd-tools/boxes' _installer_line_in_file "{{cookiecutter.project_slug}}/.gitignore" '!.cicd-tools/boxes/bootstrap' + _installer_line_in_file "{{cookiecutter.project_slug}}/.gitignore" '.vale' + _installer_line_in_file "{{cookiecutter.project_slug}}/.gitignore" '!.vale/Vocab' _installer_poetry_init "." diff --git a/scripts/install-poetry.sh b/scripts/install-poetry.sh index 50e7f5b1..420304e0 100755 --- a/scripts/install-poetry.sh +++ b/scripts/install-poetry.sh @@ -36,6 +36,8 @@ main() { _installer_line_in_file ".gitignore" '.cicd-tools/boxes/*' _installer_line_in_file ".gitignore" '!.cicd-tools/boxes/bootstrap' + _installer_line_in_file ".gitignore" '.vale' + _installer_line_in_file ".gitignore" '!.vale/Vocab' _installer_jinja_render ".github/config/workflows/workflow-push.json" _installer_jinja_render ".github/scripts/step-setup-environment.sh" diff --git a/{{cookiecutter.project_slug}}/.github/scripts/job-50-test-precommit.sh b/{{cookiecutter.project_slug}}/.github/scripts/job-50-test-precommit.sh index 43f0d560..5902e4a1 100755 --- a/{{cookiecutter.project_slug}}/.github/scripts/job-50-test-precommit.sh +++ b/{{cookiecutter.project_slug}}/.github/scripts/job-50-test-precommit.sh @@ -135,6 +135,7 @@ util() { main() { pushd "${TEST_PROJECT_NAME}" >> /dev/null + poetry run pre-commit run --hook-stage manual spelling-vale-synchronize scenario "${1}" popd >> /dev/null diff --git a/{{cookiecutter.project_slug}}/.github/workflows/workflow-push.yml b/{{cookiecutter.project_slug}}/.github/workflows/workflow-push.yml index 6ed9bfff..c269056b 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/workflow-push.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/workflow-push.yml @@ -83,6 +83,7 @@ jobs: COMMAND: | CICD_COMMIT_MESSAGES_FILE="$(mktemp XXXXXXXX.git_history_file)" git log --pretty=format:%s "${PUSHED_COMMIT_REV_RANGE}" > "${CICD_COMMIT_MESSAGES_FILE}" + poetry run pre-commit run --hook-stage manual spelling-vale-synchronize poetry run pre-commit run --hook-stage commit-msg spelling-commit-message --commit-msg-filename "${CICD_COMMIT_MESSAGES_FILE}" COMMAND_NAME: "Commit Message Spelling" CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} @@ -121,6 +122,7 @@ jobs: uses: cicd-tools-org/cicd-tools/.github/workflows/job-80-poetry-precommit_commit_stage_hook.yml@master with: CONCURRENCY: ${{ fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_concurrency_limit }} + PRE_HOOK_COMMAND: poetry run pre-commit run --hook-stage manual spelling-vale-synchronize PRECOMMIT_HOOK_ID: "spelling-markdown" PRECOMMIT_HOOK_NAME: "Markdown Spelling" PYTHON_VERSIONS: ${{ toJSON(fromJSON(needs.configuration.outputs.JSON_FILE_DATA).ci_python_versions) }} diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index 8b06c9cd..00d52410 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -2,3 +2,5 @@ poetry.lock .cicd-tools/boxes/* !.cicd-tools/boxes/bootstrap .cicd-tools/manifest.json +.vale +!.vale/Vocab diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 3d474754..080353f3 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: commitizen stages: [commit-msg] - repo: https://github.com/cicd-tools-org/pre-commit.git - rev: 0.2.0 + rev: 0.4.0 hooks: - id: format-shell args: @@ -50,6 +50,7 @@ repos: - id: security-credentials - id: spelling-commit-message - id: spelling-markdown + - id: spelling-vale-synchronize - repo: https://github.com/adrienverge/yamllint.git rev: v1.32.0 hooks: diff --git a/{{cookiecutter.project_slug}}/.vale.ini b/{{cookiecutter.project_slug}}/.vale.ini index eec77217..80d65e45 100644 --- a/{{cookiecutter.project_slug}}/.vale.ini +++ b/{{cookiecutter.project_slug}}/.vale.ini @@ -1,10 +1,16 @@ StylesPath = ".vale" Vocab = "{{cookiecutter.project_slug}}" +MinAlertLevel = suggestion + +Packages = proselint, alex, \ +https://github.com/cicd-tools-org/vale/releases/download/0.1.0/cicd-tools.zip [*] -BasedOnStyles = Vale -Vale.Terms = NO +cicd-tools.PythonProject = YES +Vale.Avoid = YES [*.md] -BasedOnStyles = Vale +BasedOnStyles = proselint, alex +cicd-tools.PythonProject = YES Vale.Terms = YES +Vale.Avoid = YES diff --git a/{{cookiecutter.project_slug}}/.vale/Vocab/{{cookiecutter.project_slug}}/accept.txt b/{{cookiecutter.project_slug}}/.vale/Vocab/{{cookiecutter.project_slug}}/accept.txt index e69de29b..81733e45 100644 --- a/{{cookiecutter.project_slug}}/.vale/Vocab/{{cookiecutter.project_slug}}/accept.txt +++ b/{{cookiecutter.project_slug}}/.vale/Vocab/{{cookiecutter.project_slug}}/accept.txt @@ -0,0 +1 @@ +{{cookiecutter.project_slug}}