Feature Request: Add support for the pre-commit framework
The pre-commit framework is a commonly used tool to create git hooks for code validation. Other AWS tools such as cfn-python-lint provide support for the framework
This is very reasonable ask. We're looking at integrations right now. We'll pull this into that discussion.
Looks like pre-commit natively supports rust as a buildable language plugin. If this is the case, this should be straightforward to offer.
There are still some hurdles (at least the last time I tried):
- You need to have rust installed (not much to do about that, and you can install cfn-guard yourself and use the system "language")
- pre-commit passes all matching files on one invocation (or at least does so by default). I couldn't get it to invoke cfn-guard multiple times (that's why I created #62 )
+1 to this issue. Pre-commits are a vital way of remediating latent vulnerabilities before they're committed.
Do we have any update on this Feature request to support pre-commit hooks?
if the project already have a .pre-commit-confg.yaml i see the below config works
- repo: local
hooks:
- id: cfn-guard
name: Run Cfn Guard
language: system
entry: "cfn-guard validate -r ./cfn-rules/cloudformation/aws/ --data ./cdk.out/"
pass_filenames: false
Hi @kgrvamsi we do not have any updates here yet.