Custom Linters
Last updated
Last updated
Trunk Code Quality allows you to define custom linters. If a linter is not within the or you have a bespoke solution, you can define a custom linter.
You can define linters right in your .trunk/trunk.yaml
file in your repo. These definitions have the same configurable parameters as in our or .
For example, you can define a simple that runs a custom script file. The linter passes or fails based on the status code returned.
You can also define simple linters inline using tools like grep
. This linter will grep against your custom regex pattern, format the output using sed, and then parse the output into pattern groups using a for Trunk Code Quality to report.
To see the configurable fields available .
The is public and welcomes contributions. Feel free to open a PR if the new custom linter you defined could be useful to others. You can reach out to us if you need a hand.