Skip to content

Conversation

@echarrod
Copy link
Contributor

@echarrod echarrod commented Dec 19, 2025

Summary

This PR adds support for the pre-commit framework by adding:

  1. .pre-commit-hooks.yaml - Defines the aikido-local-scanner hook for the pre-commit framework
  2. aikido-local-scanner-wrapper - A wrapper script that finds and runs the scanner binary
  3. Updated README - Documents both installation methods

Usage

After this change, users can add Aikido to their .pre-commit-config.yaml:

repos:
  - repo: https://github.com/AikidoSec/pre-commit
    rev: main  # or pin to a specific commit
    hooks:
      - id: aikido-local-scanner

The scanner binary still needs to be installed separately (the wrapper provides clear instructions if not found).

Benefits

  • Standard integration with pre-commit framework
  • Per-project configuration instead of global-only
  • Version pinning support (can pin to specific commits)
  • Works alongside other security scanning hooks
  • Cleaner integration for teams already using pre-commit

Testing

  1. Install the scanner binary using the existing installation script
  2. Add the hook to a .pre-commit-config.yaml
  3. Run pre-commit run aikido-local-scanner --all-files

Fixes #3

Summary by Aikido

🚀 New Features

  • Added pre-commit hook configuration file for Aikido scanner

Add .pre-commit-hooks.yaml and wrapper script to enable integration
with the pre-commit framework (https://pre-commit.com/).

This allows users to add Aikido to their existing pre-commit config:

```yaml
repos:
  - repo: https://github.com/AikidoSec/pre-commit
    rev: main
    hooks:
      - id: aikido-local-scanner
```

The wrapper script checks for the aikido-local-scanner binary in
common locations and provides clear installation instructions if
not found.

Fixes AikidoSec#3
@echarrod echarrod force-pushed the add-pre-commit-hooks-yaml branch from e3ae431 to 678f073 Compare December 19, 2025 14:40
@skeymeulen skeymeulen changed the base branch from main to pre-commit-support December 23, 2025 10:59
@skeymeulen skeymeulen merged commit b75adbb into AikidoSec:pre-commit-support Dec 23, 2025
1 check passed
skeymeulen added a commit that referenced this pull request Dec 23, 2025
Add pre-commit framework support (#4)
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-hooks.yaml for pre-commit framework compatibility

2 participants