Skip to content

Commit 619ffeb

Browse files
authored
Merge pull request trustyai-explainability#26 from m-misiura/pre-commit
Scope pre commit hooks rather than running them on all files
2 parents 7368d87 + ad2eed0 commit 619ffeb

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/.pre-commit.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,4 @@ jobs:
2626
pip install -e ".[test]"
2727
2828
- name: Run pre-commit
29-
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
30-
with:
31-
extra_args: --all-files
29+
uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.3.0
5+
rev: v0.13.1
66
hooks:
7-
- id: ruff
7+
- id: ruff-check
88
args: [--fix]
9+
types_or: [python, pyi]
10+
files: ^(llama_stack_provider_trustyai_fms/|tests/).*\.(py)$
911
- id: ruff-format
12+
types_or: [python, pyi]
13+
files: ^(llama_stack_provider_trustyai_fms/|tests/).*\.(py)$
1014

1115
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.5.0
16+
rev: v6.0.0
1317
hooks:
1418
- id: trailing-whitespace
19+
files: \.(py|ipynb|md)$
1520
- id: end-of-file-fixer
21+
files: \.(py|ipynb|md)$
1622
- id: check-yaml
1723
args: [--allow-multiple-documents]
24+
files: \.ya?ml$
1825
- id: check-added-large-files
1926
- id: check-merge-conflict
2027
- id: check-case-conflict
2128
- id: check-docstring-first
29+
files: ^(llama_stack_provider_trustyai_fms/|tests/).*\.(py)$
2230

2331
- repo: local
2432
hooks:
@@ -28,4 +36,4 @@ repos:
2836
language: system
2937
pass_filenames: false
3038
always_run: true
31-
stages: [pre-commit]
39+
stages: [pre-commit]

0 commit comments

Comments
 (0)