← 返回
未分类 中文

Git Hooks Manager

Manage Git hooks with easy installation, configuration, and sharing, supporting lint, test, commit message, and branch name validations.
轻松安装、配置和共享 Git Hooks,支持 lint、测试、提交信息和分支名的校验。
kaiyuelv kaiyuelv 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 358
下载
💾 0
安装
1
版本
#automation#devops#git#hooks#latest#lint#pre-commit

概述

git-hooks-manager - Git Hooks管理器

Metadata

FieldValue
--------------
Namegit-hooks-manager
Sluggit-hooks-manager
Version1.0.0
Homepagehttps://github.com/openclaw/git-hooks-manager
Categorydevelopment
Tagsgit, hooks, pre-commit, pre-push, lint, test, automation, devops

Description

English

A Git hooks manager that simplifies installing, configuring, and sharing Git hooks across teams. Includes pre-built templates for linting, testing, branch naming validation, commit message validation, and custom hook orchestration.

中文

Git Hooks管理器,简化团队间Git钩子的安装、配置和共享。包含预置模板:代码检查、测试运行、分支名验证、提交信息验证和自定义钩子编排。

Requirements

  • Python 3.8+
  • Git >= 2.30
  • click >= 8.0.0
  • colorama >= 0.4.6

Configuration

Environment Variables

HOOKS_MANAGER_STRICT=true
HOOKS_MANAGER_SKIP_LINT=false

Usage

Install Hooks

# Install all recommended hooks
python scripts/hooks_manager.py install --all

# Install specific hook
python scripts/hooks_manager.py install pre-commit

# Install from template
python scripts/hooks_manager.py install pre-commit --template lint-and-test

Create Custom Hook

from git_hooks_manager import HookManager

manager = HookManager()

# Define a custom pre-commit hook
@manager.hook("pre-commit")
def my_pre_commit():
    # Run custom checks
    result = manager.run_command("pytest", ["tests/smoke/"])
    if result.returncode != 0:
        print("Smoke tests failed!")
        return False
    return True

manager.install()

Validate Commit Messages

python scripts/hooks_manager.py validate-message "feat: add user login"

API Reference

HookManager

  • install(hook_name, template=None) - Install a hook
  • uninstall(hook_name) - Remove a hook
  • list_hooks() - List installed hooks
  • validate_commit_message(msg) - Validate conventional commits format
  • validate_branch_name(name) - Validate branch naming convention
  • run_command(cmd, args) - Run a shell command and return result

Built-in Templates

  • lint-and-test - Run linters and unit tests
  • conventional-commits - Validate commit messages
  • branch-guard - Enforce branch naming rules
  • security-scan - Run basic security checks
  • ci-simulation - Simulate CI pipeline locally

Examples

See examples/ directory for complete examples.

Testing

cd /root/.openclaw/workspace/skills/git-hooks-manager
python -m pytest tests/ -v

License

MIT License

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 16:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Smart Crawler

kaiyuelv
智能爬虫工具 - 企业级数据采集与反爬虫处理 | Smart Web Crawler - Enterprise data collection with anti-detection
★ 2 📥 1,848
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 195 📥 67,587
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,691