Files
nexus/wiki/concepts/Pre-commit-Hooks.md

35 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Pre-commit Hooks"
type: concept
tags:
- GitOps
- DevOps
- CI/CD
- Automation
last_updated: 2026-05-11
---
# Pre-commit Hooks
## Definition
在提交代码前运行的脚本工具通常用于代码格式化、linting、安全扫描等。Renovate Bot 可以自动检测并更新这些钩子插件的版本号。
## Core Functions
-`git commit` 前自动执行检查脚本
- 常用场景代码格式化Prettier、lintingESLint、安全扫描Trivy、Secrets 检测
- 版本管理:保持钩子插件版本与最新安全修复同步
- Renovate 集成:自动为 pre-commit 配置文件(如 `.pre-commit-config.yaml`)中的版本标签创建更新 PR
## Related Concepts
- [[Renovate-Bot]] — Renovate Bot 可自动更新 pre-commit 钩子插件版本
- [[Dependency-Management]] — pre-commit 钩子是项目依赖的一部分
- [[GitOps]] — pre-commit 是 GitOps 工作流中的质量门禁
## Related Sources
- [[ctp-topic-15-working-with-renovatebot]]
## Aliases
- Git Hooks
- Pre-commit Framework
- pre-commit-config.yaml