Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add support for the pre-commit framework #22

Open
dontirun opened this issue Jun 22, 2020 · 7 comments
Open

Feature Request: Add support for the pre-commit framework #22

dontirun opened this issue Jun 22, 2020 · 7 comments
Labels
enhancement New feature or request needs-research

Comments

@dontirun
Copy link

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

@dontirun dontirun changed the title Add support for the pre-commit framework Feature Request: Add support for the pre-commit framework Jun 22, 2020
@nathanataws nathanataws added the enhancement New feature or request label Jun 23, 2020
@nathanataws
Copy link
Contributor

This is very reasonable ask. We're looking at integrations right now. We'll pull this into that discussion.

@johnttompkins
Copy link
Contributor

Looks like pre-commit natively supports rust as a buildable language plugin. If this is the case, this should be straightforward to offer.

@benbridts
Copy link
Contributor

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 [Enhancement] Run cfn-guard check without parameters #62 )

priyap286 pushed a commit that referenced this issue May 17, 2021
@barnesrobert
Copy link

+1 to this issue. Pre-commits are a vital way of remediating latent vulnerabilities before they're committed.

@kgrvamsi
Copy link

Do we have any update on this Feature request to support pre-commit hooks?

@kgrvamsi
Copy link

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
       

@joshfried-aws
Copy link
Contributor

Hi @kgrvamsi we do not have any updates here yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-research
Projects
None yet
Development

No branches or pull requests

9 participants