Merge pull request #1 from MotifTechnologies/add_action
Browse files- .github/workflows/pre-commit.yml +30 -0
- .pre-commit-config.yaml +2 -1
.github/workflows/pre-commit.yml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: pre-commit
|
2 |
+
|
3 |
+
on:
|
4 |
+
pull_request:
|
5 |
+
push:
|
6 |
+
branches: [ main, master ]
|
7 |
+
|
8 |
+
jobs:
|
9 |
+
run-pre-commit:
|
10 |
+
runs-on: ubuntu-latest
|
11 |
+
permissions:
|
12 |
+
contents: read
|
13 |
+
pull-requests: read
|
14 |
+
steps:
|
15 |
+
- uses: actions/checkout@v4
|
16 |
+
|
17 |
+
- uses: actions/setup-python@v5
|
18 |
+
with:
|
19 |
+
python-version: "3.11"
|
20 |
+
|
21 |
+
- name: Cache pre-commit
|
22 |
+
uses: actions/cache@v4
|
23 |
+
with:
|
24 |
+
path: ~/.cache/pre-commit
|
25 |
+
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
26 |
+
restore-keys: |
|
27 |
+
pre-commit-${{ runner.os }}-
|
28 |
+
|
29 |
+
- name: Run pre-commit
|
30 |
+
uses: pre-commit/[email protected]
|
.pre-commit-config.yaml
CHANGED
@@ -4,7 +4,7 @@ default_install_hook_types:
|
|
4 |
default_stages:
|
5 |
- pre-commit # Run locally
|
6 |
- manual # Run in CI
|
7 |
-
exclude: '(build|result)
|
8 |
repos:
|
9 |
- repo: https://github.com/google/yapf
|
10 |
rev: v0.43.0
|
@@ -15,6 +15,7 @@ repos:
|
|
15 |
rev: v1.34.0
|
16 |
hooks:
|
17 |
- id: typos
|
|
|
18 |
- repo: https://github.com/PyCQA/isort
|
19 |
rev: 6.0.1
|
20 |
hooks:
|
|
|
4 |
default_stages:
|
5 |
- pre-commit # Run locally
|
6 |
- manual # Run in CI
|
7 |
+
exclude: '(build|result)/.*|__pycache__/.*|.*\.(png|html)$'
|
8 |
repos:
|
9 |
- repo: https://github.com/google/yapf
|
10 |
rev: v0.43.0
|
|
|
15 |
rev: v1.34.0
|
16 |
hooks:
|
17 |
- id: typos
|
18 |
+
exclude: '.gitattributes'
|
19 |
- repo: https://github.com/PyCQA/isort
|
20 |
rev: 6.0.1
|
21 |
hooks:
|