Skip to content

Commit 9652f20

Browse files
committed
ENH: Add "pre-commit" GitHub Actions workflow
Adds workflow leveraging pre-commit, a framework for managing and maintaining pre-commit hooks. See https://pre-commit.com/ and https://github.com/pre-commit/action Running the pre-commit locally can be done using the following command: pipx run pre-commit run --all-files
1 parent 28e829f commit 9652f20

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI (pre-commit)
2+
3+
on:
4+
# Triggers the workflow on push or pull request events
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
lint:
16+
name: Lint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
20+
21+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
22+
23+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
args: ["--maxkb=1024"]
7+
- id: check-case-conflict
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-yaml
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: trailing-whitespace
14+
15+
- repo: https://github.com/rbubley/mirrors-prettier
16+
rev: "v3.5.3"
17+
hooks:
18+
- id: prettier
19+
types_or: [yaml]
20+
21+
- repo: https://github.com/python-jsonschema/check-jsonschema
22+
rev: "0.33.0"
23+
hooks:
24+
- id: check-dependabot
25+
- id: check-github-workflows

0 commit comments

Comments
 (0)