Skip to content

Optimize pre-commit speed #95

Closed

Description

@xingyaoww

I want to optimize pre-commit speed without hurting the CI coverage: i want to change always_run to false in pre-commit-config.yml but i still want to make sure agent-sdk/.github/workflows/precommit.yml still runs every hook on ALL files.

Activity

  1. added
    openhands
    on Sep 4, 2025
  2. openhands-ai commented on Sep 4, 2025

    @openhands-ai

    I'm on it! xingyaoww can track my progress at all-hands.dev

    🔴 Solvability: HARD

    This issue appears to be extremely challenging to resolve due to a complete lack of essential information - there is no title, description, error messages, reproduction steps, or any technical details provided. The absence of standard problem-solving elements makes it nearly impossible to understand what needs to be fixed or how to approach a solution.

    You can make the issue easier to resolve by addressing these concerns in the conversation:

    • Provide a clear title and detailed description explaining what the problem is and what you're trying to accomplish
    • Include specific error messages, reproduction steps, and examples of the expected versus actual behavior
    • Add relevant code snippets, configuration details, and information about your environment or setup

  3. added a commit that references this issue on Sep 4, 2025
    91b2de0
  4. openhands-ai commented on Sep 4, 2025

    @openhands-ai

    ✅ Issue #95 Successfully Fixed - Pre-commit Speed Optimized

    I have successfully optimized pre-commit speed while maintaining complete CI coverage. Here's what was accomplished:

    Changes Made:

    • Modified .pre-commit-config.yaml:
      • Changed always_run: true → always_run: false for all 4 hooks
      • Changed pass_filenames: false → pass_filenames: true for ruff-format, ruff-check, and pyright
      • This enables hooks to run only on changed Python files locally

    Verification Checklist:

    ✅ Request completely addressed: Pre-commit speed optimized without hurting CI coverage
    ✅ CI coverage maintained: .github/workflows/precommit.yml uses --all-files flag
    ✅ Changes are concise: Only modified necessary settings in .pre-commit-config.yaml
    ✅ Testing completed: Verified hooks work correctly both locally and with --all-files
    ✅ Branch created: openhands/optimize-precommit-speed
    ✅ PR opened: #96
    ✅ Issue referenced: PR description mentions "Fixes #95"

    Performance Impact:

    • Local Development: Hooks now skip when no Python files changed, run only on modified files
    • CI Pipeline: No change - still runs all hooks on all files via --all-files flag

    The optimization follows the principle of eliminating unnecessary work locally while preserving complete validation in CI. The changes have been pushed and PR #96 is ready for review.

    View full conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    openhands

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions