Skip to content

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

Closed

Description

@dontirun

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

Activity

  1. changed the title [-]Add support for the pre-commit framework[/-] [+]Feature Request: Add support for the pre-commit framework[/+] on Jun 22, 2020
  2. nathanataws commented on Jun 23, 2020

    @nathanataws
    Contributor

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

  3. johnttompkins commented on Feb 25, 2021

    @johnttompkins
    Contributor

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

  4. benbridts commented on Feb 25, 2021

    @benbridts
    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 )
  5. added a commit that references this issue on May 17, 2021
  6. barnesrobert commented on Jun 1, 2021

    @barnesrobert

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

  7. kgrvamsi commented on Apr 26, 2023

    @kgrvamsi

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

  8. kgrvamsi commented on Apr 27, 2023

    @kgrvamsi

    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
           
    
  9. joshfried-aws commented on Jun 22, 2023

    @joshfried-aws
    Contributor

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

  10. dannyvassallo commented on Jul 9, 2024

    @dannyvassallo
    Contributor

    @kgrvamsi the initial implementation with documentation has been merged to the main branch of the repo. I'm going to close this issue and we can track anything that comes up in the future in a new one. Thanks to everyone for their patience on this and we hope you enjoy using the new hook!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions