Skip to content

Commit 874f3c2

Browse files
committed
ci: Move Ruff and Black to pre-commit
1 parent f922f7c commit 874f3c2

File tree

2 files changed

+10
-30
lines changed

2 files changed

+10
-30
lines changed

.github/workflows/build_lint.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,3 @@ jobs:
3737
run: pip install mesa pytest
3838
- name: Test with pytest
3939
run: pytest test_examples.py
40-
41-
lint-ruff:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@v3
45-
- name: Set up Python 3.10
46-
uses: actions/setup-python@v4
47-
with:
48-
python-version: "3.10"
49-
- run: pip install ruff==0.0.275
50-
- name: Lint with ruff
51-
# Include `--format=github` to enable automatic inline annotations.
52-
# Use settings from pyproject.toml.
53-
run: ruff . --format=github
54-
55-
lint-black:
56-
runs-on: ubuntu-latest
57-
steps:
58-
- uses: actions/checkout@v3
59-
- name: Set up Python 3.10
60-
uses: actions/setup-python@v4
61-
with:
62-
python-version: "3.10"
63-
- run: pip install black[jupyter]
64-
- name: Lint with black
65-
run: black --check .

.pre-commit-config.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ ci:
33
autofix_prs: false
44

55
repos:
6-
- repo: https://github.com/psf/black
7-
rev: 23.12.1
8-
hooks:
9-
- id: black-jupyter
6+
- repo: https://github.com/astral-sh/ruff-pre-commit
7+
# Ruff version.
8+
rev: v0.1.6
9+
hooks:
10+
# Run the linter.
11+
- id: ruff
12+
types_or: [ python, pyi, jupyter ]
13+
# Run the formatter.
14+
- id: ruff-format
15+
types_or: [ python, pyi, jupyter ]
1016
- repo: https://github.com/asottile/pyupgrade
1117
rev: v3.15.0
1218
hooks:

0 commit comments

Comments
 (0)