Skip to content

packit/pre-commit-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pre-commit-hooks

Our repo for managing pre-commit hooks

Our hooks

  • check-rebase - Check if your branch is up-to-date with the upstream.
    • Specify the url of the upstream repo in args: [git://github...].
  • validate-config - Validate a package config for Packit.
    • Requires bash.
    • Runs the validation if there's a packit binary present.
    • Passes if packit is not installed; this is useful if you can't install packit in the CI but still want to run the hook at least locally.
  • validate-config-in-container - Validate a package config for Packit.
    • Uses packit image to run packit in a container.
    • Requires docker binary to be present, which can be a problem for example in pre-commit.ci

Using check-rebase with pre-commit

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/packit/pre-commit-hooks
    rev: v1.2.0
    hooks:
      - id: check-rebase
        args: [upstream_url]

Using validate-config with pre-commit

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/packit/pre-commit-hooks
    rev: v1.2.0
    hooks:
      - id: validate-config

or

-   repo: https://github.com/packit/pre-commit-hooks
    rev: v1.2.0
    hooks:
      - id: validate-config-in-container