Skip to content
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/format-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# Install formatting tools
- name: Install formatting tools
run: |
python -m pip install ruff pre-commit
python -m pip install ruff prek
python -m pip list

# Run "make format" and commit the change to the PR branch
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/style_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:

- name: Install packages
run: |
python -m pip install ruff pre-commit
python -m pip install ruff prek
python -m pip list

- name: Formatting check (ruff + pre-commit)
- name: Formatting check (ruff + prek)
run: |
make check
pre-commit run --all-files
prek run --all-files

- name: Ensure example scripts have at least one code block separator
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test_no_images: _runtest
format:
ruff check --fix --exit-zero $(FORMAT_FILES)
ruff format $(FORMAT_FILES)
pre-commit run --all-files
prek run --all-files

check:
ruff check $(FORMAT_FILES)
Expand Down
8 changes: 4 additions & 4 deletions doc/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ the code yourself. Before committing, run it to automatically format your code:
make format
```

For consistency, we also use `pre-commit` hooks to enforce UNIX-style line endings
(`\n`) and file permission 644 (`-rw-r--r--`) throughout the whole project.
Don't worry if you forget to do it. Our continuous integration systems will
warn us and you can make a new commit with the formatted code.
For consistency, we also use `pre-commit` hooks (via [`prek`](https://prek.j178.dev/))
to enforce UNIX-style line endings (`\n`) and file permission 644 (`-rw-r--r--`)
throughout the whole project. Don't worry if you forget to do it. Our continuous
integration systems will warn us and you can make a new commit with the formatted code.
Even better, you can just write `/format` in the first line of any comment in a
pull request to lint the code automatically.

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- python-build
# Dev dependencies (style checks)
- codespell
- pre-commit
- prek
- ruff>=0.12.0
# Dev dependencies (unit testing)
- matplotlib-base
Expand Down
Loading