Skip to content

Conversation

@sohal
Copy link
Contributor

@sohal sohal commented Feb 5, 2026

Implement zero-configuration pre-commit integration for downstream users with automatic hook installation on container startup.

Changes:

  • Add setup-pre-commit script for automatic hook configuration
  • Update Dockerfile to install setup script in user PATH
  • Configure devcontainer.json with setup-pre-commit in postCreateCommand
  • Add comprehensive test suite for pre-commit auto-setup functionality
  • Create example templates for downstream projects (devcontainer + config)
  • Update documentation (README, DEVCONTAINER.md, PRE-COMMIT.md)
  • Add CI/CD tests for hook installation and execution

Key Features:

  • Pre-commit binary pre-installed in Docker image
  • Auto-detects git repos and .pre-commit-config.yaml files
  • Installs hooks automatically on dev container creation
  • Idempotent setup (safe to run multiple times)
  • Graceful handling of non-git directories
  • Zero manual configuration required for downstream users

Downstream Usage:
Users only need to add .pre-commit-config.yaml to their project root and include setup-pre-commit in their devcontainer postCreateCommand. Hooks install automatically when the container starts.

Testing:

  • Local test script: ./scripts/test.sh precommit
  • CI/CD tests cover all scenarios (no git, no config, with config)
  • Verifies hook installation, idempotency, and execution

Closes #14

Description

Please include a summary of the changes and the related issue.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • I have tested the Docker image builds successfully
  • I have tested the tools work correctly inside the container
  • I have verified ARM toolchains function properly
  • I have updated the documentation accordingly

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Implement zero-configuration pre-commit integration for downstream
users with automatic hook installation on container startup.

Changes:
- Add setup-pre-commit script for automatic hook configuration
- Update Dockerfile to install setup script in user PATH
- Configure devcontainer.json with setup-pre-commit in postCreateCommand
- Add comprehensive test suite for pre-commit auto-setup functionality
- Create example templates for downstream projects (devcontainer + config)
- Update documentation (README, DEVCONTAINER.md, PRE-COMMIT.md)
- Add CI/CD tests for hook installation and execution

Key Features:
- Pre-commit binary pre-installed in Docker image
- Auto-detects git repos and .pre-commit-config.yaml files
- Installs hooks automatically on dev container creation
- Idempotent setup (safe to run multiple times)
- Graceful handling of non-git directories
- Zero manual configuration required for downstream users

Downstream Usage:
Users only need to add .pre-commit-config.yaml to their project root
and include setup-pre-commit in their devcontainer postCreateCommand.
Hooks install automatically when the container starts.

Testing:
- Local test script: ./scripts/test.sh precommit
- CI/CD tests cover all scenarios (no git, no config, with config)
- Verifies hook installation, idempotency, and execution

Closes #14
@sohal sohal linked an issue Feb 5, 2026 that may be closed by this pull request
@sohal sohal merged commit 29a3389 into main Feb 5, 2026
2 checks passed
@sohal sohal deleted the 14-add-pre-commit-to-docker-as-pre-installed-package branch February 5, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add pre-commit to docker as pre-installed package

1 participant