Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
idoknow
Campux
Repository navigation
Code
Issues
2
(2)
Pull requests
1
(1)
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
Campux
/
commitlint.config.cjs
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
44 lines (44 loc) · 1.61 KB
main
Breadcrumbs
Campux
/
commitlint.config.cjs
Copy path
Top
File metadata and controls
Code
Blame
44 lines (44 loc) · 1.61 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Commitlint 配置 —— Semantic / Conventional Commits 规范的单一规则源。
*
* 同时被以下两处使用,保证本地与 CI 规则一致:
* - .github/workflows/pr-lint.yml 的「commitlint」任务(校验 PR 内每条 commit)
* - 本地 git hook(可选,见文件末尾说明)
*
* 提交信息格式: <type>(<scope>): <subject>
* type 必填,取值见下方 type-enum
* scope 选填(如 web / server / db / dash / docs / landing …)
* subject 必填,简述本次改动(中文/英文均可,结尾不加句号)
*
* 示例:
* feat(web): 登录页拆分为双视图
* fix(server): 修复凑批发布卡在「发布中」的问题
* docs(readme): 补充自托管部署说明
*/
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
// 允许的 type 取值(Conventional Commits 标准集)
"type-enum": [
2,
"always",
[
"feat", // 新功能
"fix", // 修复缺陷
"docs", // 仅文档
"style", // 不影响逻辑的格式化(空格、分号等)
"refactor", // 重构(既非新增功能也非修复)
"perf", // 性能优化
"test", // 测试相关
"build", // 构建系统或依赖变更
"ci", // CI 配置与脚本
"chore", // 杂项(不修改 src 或测试)
"revert", // 回滚某次提交
],
],
// 中文 subject 不强制大小写规则
"subject-case": [0],
// 标题(header)整体长度上限,放宽到 120 以容纳中文说明
"header-max-length": [2, "always", 120],
},
};
You can’t perform that action at this time.