Skip to content

Commit 58109b2

Browse files
Refactor linting workflow to use pre-commit
- Updated .github/workflows/lint.yml to use pre-commit instead of running ruff and mypy separately - Updated .pre-commit-config.yaml with latest versions and proper mypy configuration - Updated README.md to reflect the workflow changes - Maintains same linting behavior while consolidating tools under pre-commit
1 parent 1cd3eeb commit 58109b2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@ jobs:
1515
run: |
1616
python -m pip install --upgrade pip
1717
pip install ".[dev]"
18-
- name: Run ruff
19-
run: ruff check .
20-
- name: Run mypy
21-
run: mypy starter_repo tests
18+
- name: Run pre-commit
19+
run: pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
repos:
2-
- repo: https://github.com/charliermarsh/ruff-pre-commit
3-
rev: v0.1.6
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.4.4
44
hooks:
55
- id: ruff
66
args: [--fix]
77
- id: ruff-format
88
- repo: https://github.com/pre-commit/mirrors-mypy
9-
rev: v1.7.1
9+
rev: v1.10.0
1010
hooks:
11-
- id: mypy
11+
- id: mypy
12+
files: ^(starter_repo|tests)/
13+
additional_dependencies: [pandas-stubs]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pre-commit install
6161

6262
GitHub Actions workflows are set up for:
6363

64-
- [Linting](.github/workflows/lint.yml): Runs Ruff and mypy
64+
- [Linting](.github/workflows/lint.yml): Runs pre-commit hooks (Ruff and mypy)
6565
- [Testing](.github/workflows/test.yml): Runs pytest on multiple Python versions
6666

6767

0 commit comments

Comments
 (0)