Skip to content

Commit ad6d3ba

Browse files
andrewgsavagelucascolleypavelzw
authored
add linter (#15)
* add lint * move typing comment * add numpydoc * Update .pre-commit-config.yaml Co-authored-by: Pavel Zwerschke <[email protected]> * fixes --------- Co-authored-by: Lucas Colley <[email protected]> Co-authored-by: Pavel Zwerschke <[email protected]>
1 parent a9baedd commit ad6d3ba

File tree

5 files changed

+1602
-53
lines changed

5 files changed

+1602
-53
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818

1919
jobs:
2020
lint:
21-
name: Format
21+
name: Lint
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.pre-commit-config.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
# ensure pixi environments are up to date
5+
# workaround for https://github.com/prefix-dev/pixi/issues/1482
6+
- id: pixi-install
7+
name: Update pixi lint environment
8+
entry: pixi install -e default -e lint
9+
pass_filenames: false
10+
language: system
11+
always_run: true
12+
require_serial: true
13+
14+
# pre-commit-hooks
15+
- id: trailing-whitespace-fixer
16+
name: Fix trailing whitespace with pre-commit-hooks
17+
entry: pixi run -e lint trailing-whitespace-fixer
18+
language: system
19+
types: [text]
20+
21+
# pre-commit-hooks
22+
- id: end-of-file-fixer
23+
name: Fix end-of-file with pre-commit-hooks
24+
entry: pixi run -e lint end-of-file-fixer
25+
language: system
26+
types: [text]
27+
28+
- id: ruff check
29+
name: Lint with ruff
30+
entry: pixi run -e lint ruff check --force-exclude --fix
31+
language: system
32+
types_or: [python, pyi, jupyter]
33+
require_serial: true
34+
35+
- id: ruff format
36+
name: Format with ruff
37+
entry: pixi run -e lint ruff format --force-exclude
38+
language: system
39+
types_or: [python, pyi, jupyter]
40+
require_serial: true
41+
42+
- id: mdformat
43+
name: Format markdown with mdformat
44+
entry: pixi run -e lint mdformat
45+
language: system
46+
types: [markdown]
47+
48+
- id: taplo
49+
name: Format TOML with taplo
50+
entry: pixi run -e lint taplo fmt
51+
language: system
52+
types: [toml]
53+
54+
- id: numpydoc-validation
55+
name: numpydoc-validation
56+
entry: pixi run -e lint numpydoc lint
57+
require_serial: false
58+
language: system
59+
types: [python]

0 commit comments

Comments
 (0)