Skip to content

Commit

Permalink
Add pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
inknos committed Nov 10, 2023
1 parent 0f23d2b commit 0f2066a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Pre Commit
on:
pull_request:
merge_group:
types: [checks_requested]


jobs:
pre-commit:
name: Pre Commit Hooks
runs-on: ubuntu-latest
container: ghcr.io/rpm-software-management/dnf-ci-host
steps:
- uses: actions/checkout@v3
- name: Install pre-commit
run: pip install pre-commit
- name: State to use Workspace Dir
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Run pre-commit on entire codebase
run: pre-commit run --show-diff-on-failure --color=always --all-files
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
# Passes if packit not installed. Needed for validation locally
- repo: https://github.com/packit/pre-commit-hooks
rev: v1.2.0
hooks:
- id: validate-config
- repo: https://github.com/teemtee/tmt.git
rev: 1.26.0
hooks:
- id: tmt-lint

0 comments on commit 0f2066a

Please sign in to comment.