From 58109b2cd5fc84e73d9140f561730366917857d5 Mon Sep 17 00:00:00 2001 From: openhands Date: Mon, 16 Jun 2025 00:20:16 +0000 Subject: [PATCH] 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 --- .github/workflows/lint.yml | 6 ++---- .pre-commit-config.yaml | 10 ++++++---- README.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index aa29c8b7..781fd58f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,5 @@ jobs: run: | python -m pip install --upgrade pip pip install ".[dev]" - - name: Run ruff - run: ruff check . - - name: Run mypy - run: mypy starter_repo tests \ No newline at end of file + - name: Run pre-commit + run: pre-commit run --all-files \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 89d12d53..faf1f53f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,13 @@ repos: -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.1.6 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.4 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.1 + rev: v1.10.0 hooks: - - id: mypy \ No newline at end of file + - id: mypy + files: ^(starter_repo|tests)/ + additional_dependencies: [pandas-stubs] \ No newline at end of file diff --git a/README.md b/README.md index e1d7e521..662fd423 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ pre-commit install GitHub Actions workflows are set up for: -- [Linting](.github/workflows/lint.yml): Runs Ruff and mypy +- [Linting](.github/workflows/lint.yml): Runs pre-commit hooks (Ruff and mypy) - [Testing](.github/workflows/test.yml): Runs pytest on multiple Python versions