Skip to content

Conversation

@edmundmiller
Copy link
Contributor

Summary

  • Set up comprehensive post-edit hooks that automatically run tests, linting, and type checking after file edits
  • Add intelligent hook script that detects file types and runs appropriate commands using uv run
  • Configure hooks to trigger on Edit/MultiEdit/Write tool usage

Key Features

  • Smart Test Execution: Automatically runs specific test files when test_*.py files are edited
  • Related Test Discovery: When editing source files in nf_core/, automatically finds and runs corresponding test files
  • Code Quality Checks: Runs ruff linting, formatting validation, and mypy type checking on Python files
  • Project Convention Compliance: Uses uv run commands per project standards
  • Clear Feedback: Provides emoji-based success/failure indicators with detailed error output

Technical Implementation

  • Hook Script: .claude/hooks/post-edit.py - Python script that analyzes edited files and executes appropriate commands
  • Configuration: Updated .claude/settings.local.json with PostToolUse hooks for Edit/MultiEdit/Write tools
  • Error Handling: Proper timeout management (3 minutes) and meaningful error messages
  • File Intelligence: Distinguishes between test files, source files, and other Python files for targeted actions

Test Plan

  • Test hook triggers on file edits
  • Verify test execution for both test files and source files
  • Confirm linting and type checking run on appropriate files
  • Validate error handling and feedback mechanisms

🤖 Generated with Claude Code

nvnieuwk and others added 30 commits September 2, 2025 11:28
Co-authored-by: Júlia Mir Pedrol <[email protected]>
Linting: do not check pytest_modules.yml file, deprecating
Add Host Requirements to Devcontainer Config
Fix Downloads: Clean up temporary files from singularity pull and set correct file permissions for http downloads
mashehu and others added 27 commits October 15, 2025 10:06
Co-authored-by: Matthias Hörtenhuber <[email protected]>
feat: Add codespaces badge to template README
Co-authored-by: Júlia Mir Pedrol <[email protected]>
Co-authored-by: Júlia Mir Pedrol <[email protected]>
@mashehu
Copy link
Contributor

mashehu commented Oct 24, 2025

looks like a duplicate of #3676

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.