Skip to content

add linter #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

jobs:
lint:
name: Format
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
repos:
- repo: local
hooks:
# ensure pixi environments are up to date
# workaround for https://github.com/prefix-dev/pixi/issues/1482
- id: pixi-install
name: Update pixi lint environment
entry: pixi install -e default -e lint
pass_filenames: false
language: system
always_run: true
require_serial: true

# pre-commit-hooks
- id: trailing-whitespace-fixer
name: Fix trailing whitespace with pre-commit-hooks
entry: pixi run -e lint trailing-whitespace-fixer
language: system
types: [text]

# pre-commit-hooks
- id: end-of-file-fixer
name: Fix end-of-file with pre-commit-hooks
entry: pixi run -e lint end-of-file-fixer
language: system
types: [text]

- id: ruff check
name: Lint with ruff
entry: pixi run -e lint ruff check --force-exclude --fix
language: system
types_or: [python, pyi, jupyter]
require_serial: true

- id: ruff format
name: Format with ruff
entry: pixi run -e lint ruff format --force-exclude
language: system
types_or: [python, pyi, jupyter]
require_serial: true

- id: mdformat
name: Format markdown with mdformat
entry: pixi run -e lint mdformat
language: system
types: [markdown]

- id: taplo
name: Format TOML with taplo
entry: pixi run -e lint taplo fmt
language: system
types: [toml]

- id: numpydoc-validation
name: numpydoc-validation
entry: pixi run -e lint numpydoc lint
require_serial: false
language: system
types: [python]
Loading
Loading