Skip to content

Commit a7e9ad3

Browse files
committed
Specify hook stages explicitly
1 parent 0af96f0 commit a7e9ad3

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

.github/workflows/hamilton-main.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,28 @@ on:
1414
- 'pyproject.toml'
1515

1616
jobs:
17+
static-checks:
18+
name: "Static Checks"
19+
runs-on: ubuntu-latest
20+
env:
21+
UV_PRERELEASE: "allow"
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Install uv and set the python version
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
python-version: '3.10'
30+
enable-cache: true
31+
cache-dependency-glob: "uv.lock"
32+
activate-environment: true
33+
34+
- name: Check linting with prek
35+
run: |
36+
uv sync --dev
37+
uv run prek run --all-files --hook-stage pre-merge-commit
38+
1739
test:
1840
name: "Unit Tests"
1941
runs-on: ${{ matrix.os }}
@@ -59,14 +81,6 @@ jobs:
5981
cache-dependency-glob: "uv.lock"
6082
activate-environment: true
6183

62-
# It's enough to do it on single OS
63-
- name: Check linting with prek
64-
if: ${{ runner.os == 'Linux' }}
65-
run: |
66-
uv sync --dev
67-
uv run prek install
68-
uv run prek run --all-files
69-
7084
- name: Test hamilton main package
7185
run: |
7286
uv sync --group test

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# $ cd /PATH/TO/REPO
2222
# $ prek install
2323
exclude: '^docs/code-comparisons/' # skip the code comparisons directory
24+
default_stages: [pre-commit, pre-merge-commit]
2425
repos:
2526
- repo: https://github.com/astral-sh/ruff-pre-commit
2627
# Ruff version.

0 commit comments

Comments
 (0)