diff --git a/.github/codeql/codeql-config.yaml b/.github/codeql/codeql-config.yaml index ac9f5f2b..235000fd 100644 --- a/.github/codeql/codeql-config.yaml +++ b/.github/codeql/codeql-config.yaml @@ -1,3 +1,5 @@ +# yamllint disable rule:document-start rule:document-end + name: CodeQL configuration paths: - src/package diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index dba34177..02983b10 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -1,6 +1,8 @@ # This configuration file enables Dependabot version updates. # https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates # https://github.com/dependabot/feedback/issues/551 +# +# yamllint disable rule:document-start rule:document-end version: 2 updates: diff --git a/.github/workflows/_build.yaml b/.github/workflows/_build.yaml index 3268d4fc..5137ea5d 100644 --- a/.github/workflows/_build.yaml +++ b/.github/workflows/_build.yaml @@ -18,9 +18,11 @@ # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions # # for the security recommendations. +# +# yamllint disable rule:document-start rule:document-end name: Build the package -on: +on: # yamllint disable-line rule:truthy workflow_call: inputs: disable_pip_audit: diff --git a/.github/workflows/_generate-rebase.yaml b/.github/workflows/_generate-rebase.yaml index 29f4bda5..a6351566 100644 --- a/.github/workflows/_generate-rebase.yaml +++ b/.github/workflows/_generate-rebase.yaml @@ -1,8 +1,10 @@ # Automatically rebase one branch on top of another; usually staging on top # of main after a new package version was published. +# +# yamllint disable rule:document-start rule:document-end name: Rebase branch -on: +on: # yamllint disable-line rule:truthy workflow_call: inputs: to_head: diff --git a/.github/workflows/_release-notifications.yaml b/.github/workflows/_release-notifications.yaml index bf4481b4..b838cb46 100644 --- a/.github/workflows/_release-notifications.yaml +++ b/.github/workflows/_release-notifications.yaml @@ -1,8 +1,10 @@ # Send a Slack release notification. Instructions to set up Slack to receive # messages can be found here: https://github.com/slackapi/slack-github-action#setup-2 +# +# yamllint disable rule:document-start rule:document-end name: Release Notifications -on: +on: # yamllint disable-line rule:truthy workflow_call: inputs: repo_name: diff --git a/.github/workflows/_wiki-documentation.yaml b/.github/workflows/_wiki-documentation.yaml index 0a60b1bf..495b1858 100644 --- a/.github/workflows/_wiki-documentation.yaml +++ b/.github/workflows/_wiki-documentation.yaml @@ -1,9 +1,11 @@ # This reusable workflow publishes Markdown docs to Github Wiki. Some manual # setup is required before using it: enable Wiki in repository and create at # least one page. +# +# yamllint disable rule:document-start rule:document-end name: Publish Github Wiki documentation -on: +on: # yamllint disable-line rule:truthy workflow_call: inputs: release_tag: diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 567d6b3a..25ad349c 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -1,8 +1,10 @@ # Run CodeQL over the package. For more configuration options see codeql/codeql-config.yaml # and: https://github.com/github/codeql-action +# +# yamllint disable rule:document-start rule:document-end name: CodeQL -on: +on: # yamllint disable-line rule:truthy push: branches: - main diff --git a/.github/workflows/dependabot-automerge.yaml b/.github/workflows/dependabot-automerge.yaml index a5a64613..578ea2f3 100644 --- a/.github/workflows/dependabot-automerge.yaml +++ b/.github/workflows/dependabot-automerge.yaml @@ -1,8 +1,10 @@ # Automatically merge Dependabot PRs upon approval by leaving # a comment on Dependabot's pull-request. +# +# yamllint disable rule:document-start rule:document-end name: Automerge Dependabot PR -on: +on: # yamllint disable-line rule:truthy pull_request_review: types: [submitted] diff --git a/.github/workflows/pr-change-set.yaml b/.github/workflows/pr-change-set.yaml index 8bfc3748..4bdac8a3 100644 --- a/.github/workflows/pr-change-set.yaml +++ b/.github/workflows/pr-change-set.yaml @@ -1,8 +1,10 @@ # This workflow checks and tests the package code, and it builds all package # artifacts whenever there were changes to a pull request. +# +# yamllint disable rule:document-start rule:document-end name: Check change set -on: +on: # yamllint disable-line rule:truthy pull_request: branches: - '*' diff --git a/.github/workflows/pr-conventional-commits.yaml b/.github/workflows/pr-conventional-commits.yaml index 03233c87..b621a249 100644 --- a/.github/workflows/pr-conventional-commits.yaml +++ b/.github/workflows/pr-conventional-commits.yaml @@ -2,9 +2,11 @@ # package (https://github.com/commitizen-tools/commitizen) and its `cz` # tool to check the title of the PR and all commit messages of the branch # which triggers this Action. +# +# yamllint disable rule:document-start rule:document-end name: Check conventional commits -on: +on: # yamllint disable-line rule:truthy pull_request: branches: - '*' diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 722e43d5..c8a79dd5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,8 +1,10 @@ # We run checks on pushing to the specified branches. # Pushing to main also triggers a release. +# +# yamllint disable rule:document-start rule:document-end name: Check and Release -on: +on: # yamllint disable-line rule:truthy push: branches: - main diff --git a/.github/workflows/scorecards-analysis.yaml b/.github/workflows/scorecards-analysis.yaml index b5b84dd4..a4e27808 100644 --- a/.github/workflows/scorecards-analysis.yaml +++ b/.github/workflows/scorecards-analysis.yaml @@ -1,7 +1,9 @@ # Run Scorecard for this repository to further check and harden software and process. +# +# yamllint disable rule:document-start rule:document-end name: Scorecards supply-chain security -on: +on: # yamllint disable-line rule:truthy # Only the default branch is supported. branch_protection_rule: schedule: diff --git a/.github/workflows/sync-with-upstream.yaml b/.github/workflows/sync-with-upstream.yaml index f5ae8337..a9d12a4a 100644 --- a/.github/workflows/sync-with-upstream.yaml +++ b/.github/workflows/sync-with-upstream.yaml @@ -1,8 +1,10 @@ # Create a PR to sync with the upstream template repo. # The template repo is https://github.com/jenstroeger/python-package-template. +# +# yamllint disable rule:document-start rule:document-end name: Sync with template repository -on: +on: # yamllint disable-line rule:truthy schedule: - cron: 11 11 * * * diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 24d4fab2..b3633f5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +# yamllint disable rule:document-start rule:document-end + # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks default_install_hook_types: [pre-commit, commit-msg, pre-push] @@ -117,7 +119,6 @@ repos: - id: detect-private-key - id: detect-aws-credentials args: [--allow-missing-credentials] - - id: check-yaml - id: check-toml - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 @@ -147,9 +148,9 @@ repos: args: [--autofix] - id: pretty-format-yaml args: [--autofix] - # Commenting this out because https://github.com/pappasam/toml-sort/issues/11 - # - id: pretty-format-toml - # args: [--autofix] + # Commenting this out because https://github.com/pappasam/toml-sort/issues/11 + # - id: pretty-format-toml + # args: [--autofix] # Check GitHub Actions workflow files. - repo: https://github.com/Mateusz-Grzelinski/actionlint-py @@ -157,6 +158,14 @@ repos: hooks: - id: actionlint +# Check and lint all YAML files. +# https://yamllint.readthedocs.io/en/stable/rules.html +- repo: https://github.com/adrienverge/yamllint + rev: v1.33.0 + hooks: + - id: yamllint + args: [--strict] + # On push to the remote, run the unit tests. - repo: local hooks: diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..1be97ef8 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,15 @@ +# Modify yamllint's defaults so that they work well and strictly with +# ruamel's pretty-formatting of the YAML files. +# +# For more details: https://yamllint.readthedocs.io/en/stable/rules.html +# +# yamllint disable rule:document-start rule:document-end + +extends: default +rules: + line-length: + max: 512 + indentation: + indent-sequences: consistent + comments: + min-spaces-from-content: 1