ci(pre-commit): add pre-commit configuration (#13760)

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
This commit is contained in:
Luís Ferreira 2022-03-21 09:31:57 +00:00 committed by GitHub
parent b0d094a4de
commit 5e1e5c190a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 0 deletions

20
.github/workflows/pre_commit.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: pre_commit
on:
pull_request:
branches:
- master
push:
branches:
- master
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-latest
env:
SKIP: no-commit-to-branch
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3.0.0
- uses: pre-commit/action@v2.0.3

19
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
exclude: >
(?x)^(
^test/runnable/extra-files/.*$|
^test/compilable/extra-files/.*$|
)$
- id: check-merge-conflict
- id: check-added-large-files
- id: detect-private-key
- id: no-commit-to-branch
args: [--branch, master]
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.0
hooks:
- id: check-github-workflows