Skip to content

Commit

Permalink
ci(PRE-COMMIT): update to latest, vale config
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Mar 6, 2024
1 parent d238324 commit a8e50a0
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/job-50-test-precommit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ scenario() {

test_toml_lint_passes() {
util "git_reset"
sed -i.bak "s/python = '^3.9/python = '>=3.10.0,<4.0/g" pyproject.toml
sed -i.bak "s/python = '^3.9/python = '>=3.9.1,<4.0/g" pyproject.toml
git stage pyproject.toml
git commit -m 'test(PRE-COMMIT): upgrade python without issue'
}
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/workflow-cookiecutter-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/workflow-meta_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
!.cicd-tools/boxes/bootstrap
.cicd-tools/manifest.json
.cicd-tools/manifest.json.asc
.vale
!.vale/Vocab
poetry.lock
node_modules/*
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

Managed, Centralized CI/CD Components. A platform in a repository.

#### Master Branch (Please consume this branch.)
<!-- vale off -->
## Master Branch Builds
<!-- vale on -->
- [![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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ python = '^3.9'
[tool.poetry.group.dev.dependencies]
ansible = '^7.5.0'
check-jsonschema = '^0.22.0'
commitizen = '>=3.0.0,!=3.16.0'
commitizen = '<3.16.0'
jinja-cli = '^1.2.2'
molecule = '^5.0.0'
pre-commit = '^3.1.1'
Expand Down
8 changes: 6 additions & 2 deletions scripts/install-cookiecutter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "."

Expand Down
2 changes: 2 additions & 0 deletions scripts/install-poetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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) }}
Expand Down
2 changes: 2 additions & 0 deletions {{cookiecutter.project_slug}}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ poetry.lock
.cicd-tools/boxes/*
!.cicd-tools/boxes/bootstrap
.cicd-tools/manifest.json
.vale
!.vale/Vocab
3 changes: 2 additions & 1 deletion {{cookiecutter.project_slug}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 9 additions & 3 deletions {{cookiecutter.project_slug}}/.vale.ini
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{cookiecutter.project_slug}}

0 comments on commit a8e50a0

Please sign in to comment.