Skip to content

Commit fe7ac3d

Browse files
committed
add pre-commit to workflow
1 parent 5b55aa9 commit fe7ac3d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/pytest.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,26 @@ jobs:
3434
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 2
37+
3738
- name: Set up Python ${{ matrix.config.python-version }}
3839
uses: actions/setup-python@v5
3940
with:
4041
python-version: ${{ matrix.config.python-version }}
42+
4143
- name: Install OpenMP runtime for unit tests with xgboost learners
4244
if: matrix.config.os == 'macOS-latest'
4345
run: brew install libomp
46+
4447
- name: Install dependencies
4548
run: |
4649
python -m pip install --upgrade pip
4750
pip install -e .[dev,rdd]
48-
- name: Lint with ruff
49-
run: |
50-
# stop the build if there are Python syntax errors or undefined names
51-
ruff check . --select E9,F63,F7,F82 --output-format=full --statistics
52-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
53-
ruff check . --exit-zero --line-length 127 --output-format=full --statistics
54-
- name: Check code formatting with black
51+
52+
- name: Run pre-commit checks
5553
run: |
56-
black --check --verbose . || echo "Warning: Code is not formatted according to black"
57-
exit 0
54+
pip install pre-commit
55+
pre-commit run --all-files --show-diff-on-failure
56+
5857
- name: Test with pytest
5958
if: |
6059
matrix.config.os != 'ubuntu-latest' ||

0 commit comments

Comments
 (0)