Skip to content

Commit 45702d6

Browse files
authored
Pre-commit hooks (#61)
Install pre-commit hooks with pixi run -e dev install. On each commit pre-commit will do some checks to sanitize the code. Update python to 3.11 to comply to spec-0000, because we use scipy and numpy in our code base.
1 parent d25f351 commit 45702d6

File tree

4 files changed

+1267
-3414
lines changed

4 files changed

+1267
-3414
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@ jobs:
2323
- name: Setup pixi
2424
uses: prefix-dev/setup-pixi@v0.8.1
2525
with:
26-
pixi-version: v0.32.0
26+
pixi-version: v0.39.2
2727
environments: dev
2828
activate-environment: true
2929

3030
- name: Run ruff
3131
run: pixi run lint
32-
32+
3333
build:
3434
name: Build
3535
runs-on: ubuntu-latest
3636
steps:
3737

3838
- name: Checkout repo
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040

4141
- name: Setup pixi
4242
uses: prefix-dev/setup-pixi@v0.8.1
4343
with:
44-
pixi-version: v0.32.0
44+
pixi-version: v0.39.2
4545
environments: dev
4646
activate-environment: true
4747

@@ -61,14 +61,14 @@ jobs:
6161
fail-fast: false
6262
matrix:
6363
os: [ ubuntu-22.04, macos-13, windows-2022 ]
64-
python: [ "310", "311", "312", "313" ]
64+
python: [ "311", "312", "313" ]
6565
env:
6666
GCC_V: 11
6767
steps:
6868

6969
- name: Checkout repo
7070
uses: actions/checkout@v4
71-
71+
7272
- name: Install nightly build
7373
uses: modflowpy/install-modflow-action@v1
7474
with:
@@ -77,7 +77,7 @@ jobs:
7777
- name: Setup pixi
7878
uses: prefix-dev/setup-pixi@v0.8.1
7979
with:
80-
pixi-version: v0.32.0
80+
pixi-version: v0.39.2
8181
environments: test${{ matrix.python }}
8282
activate-environment: true
8383

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.2.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-toml
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.8.2
14+
hooks:
15+
- id: ruff
16+
types_or: [python, pyi, jupyter]
17+
args: [--fix, --exit-non-zero-on-fix]
18+
- id: ruff-format
19+
types_or: [python, pyi, jupyter]

0 commit comments

Comments
 (0)