run pre-commit in ci (#14253)

* run pre-commit in ci

prevents pre-commit regression

* IGNORE_OOB=1

* pytest

* unit test

* split
This commit is contained in:
chenyu
2026-01-20 12:24:33 -05:00
committed by GitHub
parent 22af7132cd
commit e04767e39e
2 changed files with 9 additions and 7 deletions

View File

@@ -229,14 +229,14 @@ jobs:
deps: linting
- name: Lint bad-indentation and trailing-whitespace with pylint
run: python -m pylint --disable=all -e W0311 -e C0303 --jobs=0 --indent-string=' ' --recursive=y .
- name: Lint with ruff
- name: Run pre-commit linting hooks
run: SKIP=tiny,tests,example pre-commit run --all-files
- name: Lint additional files with ruff
run: |
pip3 install --upgrade --force-reinstall ruff==0.14.10
pre-commit run ruff --all-files
python3 -m ruff check examples/mlperf/ --ignore E501
python3 -m ruff check extra/thunder/tiny/ --ignore E501 --ignore F841 --ignore E722
python3 -m ruff check extra/torch_backend/backend.py
- name: Run mypy
- name: Run mypy with lineprecision report
run: |
python -m mypy --lineprecision-report .
cat lineprecision.txt
@@ -254,10 +254,12 @@ jobs:
- name: Setup Environment
uses: ./.github/actions/setup-tinygrad
with:
key: unittest-12
pydeps: "pillow numpy ftfy regex"
key: unittest-13
pydeps: "pillow numpy ftfy regex pre-commit"
deps: testing_unit
llvm: 'true'
- name: Run pre-commit test hooks
run: SKIP=ruff,mypy pre-commit run --all-files
- name: Check Device.DEFAULT
run: python -c "from tinygrad import Device; assert Device.DEFAULT == 'CPU', Device.DEFAULT"
- name: Run unit tests

View File

@@ -52,7 +52,7 @@ linting = [
"mypy==1.19.1",
"typing-extensions",
"pre-commit",
"ruff",
"ruff==0.14.10",
"numpy",
"typeguard",
]