Shared Trunk configuration.
Trunk Code Quality is the standard linting and formatting tool across 3ware repositories. This repository provides the custom configuration required in addition to the upstream trunk-io/plugins, so all 3ware repositories share a consistent set of linters, definitions and actions.
Per-repository overrides can still be made in the local .trunk/trunk.yaml.
See plugin.yaml for the full configuration. In summary:
actionlint, checkov, cspell, git-diff-check, jsonvet, markdownlint, pre-commit-hooks, prettier, renovate, shellcheck, shfmt, trufflehog, yamllint and zizmor.
pinact is disabled in favour of gh actions-lock.
actionlintenables shellcheck integration enables all checks.jsonvetvalidates JSON5; replacescheck-jsonpre-commit hook which does not allow comments.zizmorruns with thepedanticpersona against workflows andaction.y*mlfiles.
These configs are shared with every consuming repository. Add a file with the same name to a repository to override it.
- actionlint.yaml and zizmor.yaml are customised for 3ware.
- .markdownlint.yaml, .shellcheckrc and .yamllint.yaml are the Trunk defaults, exported so consuming repositories do not need their own copies.
actions-lock-verify(pre-commit) verifies the GitHub Actions lock file when workflows or actions change.trunk-check-pre-push,trunk-fmt-pre-commitandtrunk-upgrade-availableare enabled.trunk-announceis disabled.
gh
-
Trunk CLI
>=1.25.0. The Trunk VS Code extension, recommended in.vscode/extensions.json, installs the CLI. -
ghauthenticated (gh auth login). Theactions-lock-verifyhook installs thegithub/gh-actions-lockextension on first use. -
A
.github/gh-actions-lock.versionfile in the consuming repository containing thegh-actions-lockversion to pin, for examplev0.4.0. Without it the pre-commit hook fails whenever workflows or actions change. -
Optional: Set an environment variable for
ZIZMOR_GITHUB_TOKENto enable zizmor online mode. Add this to your shell profile:export ZIZMOR_GITHUB_TOKEN="$(gh auth token)"
Avoid setting
GH_TOKENorGITHUB_TOKENlocally, becauseghuses them for git authentication. Online mode always run in CI.
Source this repository after trunk-io/plugins in .trunk/trunk.yaml.
Later sources override earlier ones.
plugins:
sources:
- id: trunk
ref: v1.11.0
uri: https://github.com/trunk-io/plugins
- id: 3ware
ref: v1.0.0
uri: https://github.com/3ware/trunk-code-quality-plugins
lint:
# Add additional linters if required
enabled:
- hadolint@2.12.0
# Disable a linter enabled by this plugin
disabled:
- cspellThe Trunk Upgrade workflow runs on the 1st of
each month and opens separate pull requests to update plugin.yaml and
.trunk/trunk.yaml.
Renovate keeps other dependencies up to date. Releases are created by release-please.