-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.commit-checker.yml
More file actions
314 lines (271 loc) · 11.4 KB
/
Copy path.commit-checker.yml
File metadata and controls
314 lines (271 loc) · 11.4 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# yaml-language-server: $schema=./.commit-checker.schema.json
# commit-checker configuration
# All fields are optional. The defaults shown below apply when omitted.
comment_language:
# enabled: false to skip diff comment checks entirely.
# Default: true
enabled: true
# required_language: the natural language comments must be written in.
# Values: korean | english | japanese | chinese | any
# "any" skips language detection (only parser correctness is checked).
# Default: korean
required_language: korean
# min_length: minimum letter count for a comment to be language-checked.
# Short/technical comments (e.g. "// TODO", "// nolint") are always skipped.
# Default: 5
min_length: 5
# check_mode: controls which comments are inspected.
# diff — only comments that touch added lines (default, fast)
# full — all comments in the staged version of the file
# Default: diff
check_mode: diff
# languages: friendly language names to parse. Takes priority over extensions.
# Supported: go, typescript, javascript, java, kotlin, python, c, cpp, csharp, swift, rust
# When omitted, extensions below are used.
# languages:
# - go
# - typescript
# - python
# locale: BCP-47 locale code that sets required_language automatically.
# Supported: ko (korean), en (english), ja (japanese), zh / zh-hans / zh-hant (chinese).
# When set, overrides required_language.
# locale: ko
# extensions: file extensions to inspect for comment language.
# Used when languages is not set.
extensions:
- .go
- .ts
- .tsx
- .js
- .jsx
- .mjs
- .java
- .kt
- .py
- .c
- .cpp
- .cs
- .swift
- .rs
# skip_directives: additional comment prefixes to skip (merged with built-ins).
# Built-in skips: todo, fixme, nolint, noqa, nosec, go:generate, http://, etc.
# skip_directives:
# - "internal:"
# - "ref:"
# no_emoji: 주석에서 이모지 사용 금지 여부 (기본값: false).
# true이면 소스 코드 주석에 이모지가 포함된 경우 에러로 보고.
# no_emoji: false
# check_strings: 문자열 리터럴도 주석과 동일하게 언어 검사 여부.
# true로 설정하면 소스 코드 내 문자열 리터럴에도 required_language가 적용됨.
# Default: false
# check_strings: false
# skip_technical_strings: check_strings=true일 때 기술적 식별자 문자열을 건너뜀 (기본값: true).
# 건너뜀 조건:
# - 슬래시(/) 포함 → 경로/MIME 타입 (예: /api/v1, application/json)
# - 소문자 없는 순수 ASCII → 대문자 상수 (예: ERR_TOKEN, MAX_SIZE)
# false로 설정하면 모든 문자열을 검사함.
# skip_technical_strings: true
# allowed_words: 언어 검사에서 무시할 영어 단어 목록.
# 주석에서 해당 단어를 제거한 뒤 나머지 텍스트로 언어를 판별합니다.
# 고유명사·기술 용어처럼 한국어 코드베이스에서도 영어로 쓰는 단어를 등록하세요.
# allowed_words:
# - TypeScript
# - JavaScript
# - API
# - URL
# allowed_words_file: 허용 단어가 한 줄에 하나씩 적힌 텍스트 파일 경로.
# '#'으로 시작하는 줄은 주석으로 무시합니다. allowed_words와 병합됩니다.
# allowed_words_file: .commit-checker-words.txt
# allowed_words_url: 허용 단어 파일을 HTTP/HTTPS로 가져올 URL.
# 형식은 allowed_words_file과 동일합니다. allowed_words, allowed_words_file과 병합됩니다.
# allowed_words_url: https://example.com/allowed-words.txt
# ignore_files: 주석 언어 검사에서 제외할 glob 패턴 목록.
# exceptions.comment_language_ignore 와 동일한 역할이며 병합되어 적용됨.
ignore_files:
- "**/*_test.go" # 테스트 파일은 영어 주석 허용
- "internal/charset/ambiguous_gen.go" # 자동 생성 파일
- "internal/comment/testdata/**" # 파서 테스트 픽스처 — 언어 혼용 허용
- "internal/checker/testdata/**" # 파서 테스트 픽스처 — 언어 혼용 허용
# file_languages: per-file language rules (first matching pattern wins).
# Overrides required_language for matching files.
# language accepts the same values as required_language, plus locale codes (ko, en, ja, zh).
# Use "any" to allow any language (e.g. for i18n / locale files).
# file_languages:
# - pattern: "locales/**"
# language: any
# - pattern: "i18n/**"
# language: english
# - pattern: "locale/ja/**"
# language: ja
# - pattern: "locale/zh/**"
# language: zh
binary_file:
# enabled: 바이너리 파일(컴파일된 실행파일 등) 커밋 차단 여부.
# git diff --staged --numstat에서 바이너리로 판별된 파일을 감지.
# Default: true
enabled: true
# ignore_files: 바이너리 파일 검사에서 제외할 glob 패턴 목록.
# 이미지, 폰트, 아이콘 등 의도적으로 포함하는 바이너리 파일을 허용.
# ignore_files:
# - "**/*.png"
# - "**/*.jpg"
# - "**/*.jpeg"
# - "**/*.gif"
# - "**/*.ico"
# - "**/*.woff"
# - "**/*.woff2"
# - "**/*.ttf"
# - "**/*.eot"
# - "**/*.pdf"
lint:
# enabled: 데이터 파일 구문 검사 활성화 여부 (기본값: true).
# YAML, JSON, XML 파일의 구문 오류를 감지.
enabled: true
yaml:
# enabled: YAML 구문 검사 활성화 (기본값: true)
enabled: true
# ignore_files: YAML lint에서 제외할 glob 패턴
# ignore_files:
# - "vendor/**"
json:
# enabled: JSON 구문 검사 활성화 (기본값: true)
enabled: true
# allow_json5: JSON5 형식 허용 (// 주석, trailing comma 등) (기본값: false)
# allow_json5: false
# ignore_files: JSON lint에서 제외할 glob 패턴.
# 기본 제외: package-lock.json, yarn.lock, pnpm-lock.yaml 등 auto-generated 파일.
# 사용자 설정 시 기본 제외를 덮어씀.
# ignore_files:
# - "package-lock.json"
# - "*.generated.json"
xml:
# enabled: XML 구문 검사 활성화 (기본값: true)
enabled: true
# ignore_files: XML lint에서 제외할 glob 패턴
# ignore_files:
# - "vendor/**"
encoding:
# enabled: 파일 인코딩 검사 활성화 여부 (기본값: true)
enabled: true
# require_utf8: UTF-8 인코딩 필수 여부 (기본값: true).
# true이면 UTF-8이 아닌 텍스트 파일의 커밋을 차단.
require_utf8: true
# ignore_files: 인코딩 검사에서 제외할 glob 패턴
# ignore_files:
# - "**/*.bin"
# - "legacy/**"
editorconfig:
# enabled: .editorconfig 규칙 검사 활성화 여부 (기본값: true).
# .editorconfig 파일이 없으면 자동으로 건너뜀.
enabled: true
# ignore_files: editorconfig 검사에서 제외할 glob 패턴 목록.
# ignore_files:
# - "vendor/**"
# - "**/*.generated.go"
commit_message:
# enabled: 커밋 메시지 검사 전체 활성화 여부 (기본값: true).
# false이면 no_ai_coauthor, no_unicode_spaces 등 모든 하위 검사를 건너뜀.
# enabled: true
# no_ai_coauthor: AI 도구의 Co-authored-by: 트레일러를 차단 (기본값: true).
# true이면 내장 AI 이메일 패턴(Copilot, Claude, Cursor, Codeium 등)과 일치하는
# Co-authored-by 줄을 거부하고 fix 명령으로 자동 제거함.
# 일반 사람 공동 작업자는 영향을 받지 않음.
# Default: true
no_ai_coauthor: true
# coauthor_remove_emails: 내장 AI 패턴에 추가로 제거할 이메일 glob 패턴 목록.
# '*' 와일드카드 지원 (예: "*@myai.internal"), 대소문자 무시.
# 내장 AI 패턴: *copilot*@*, noreply@anthropic.com, *@cursor.sh, *@codeium.com 등.
# coauthor_remove_emails:
# - "*@myai.internal"
# - "aibot@company.com"
# no_unicode_spaces: disallow invisible / non-standard Unicode characters.
# Detected using the same InvisibleRanges table as Gitea.
# Covers: NBSP (U+00A0), EM SPACE (U+2003), ZWSP (U+200B), BiDi controls, etc.
# BOM (U+FEFF) is explicitly allowed as a valid encoding marker.
# Default: true
no_unicode_spaces: true
# no_ambiguous_chars: disallow Unicode characters that visually resemble ASCII
# but are different codepoints — e.g. Cyrillic А (U+0410) vs Latin A (U+0041).
# Detection uses the same AmbiguousCharacters tables as Gitea (VSCode unicode data).
# Default: true
no_ambiguous_chars: true
# no_bad_runes: disallow invalid UTF-8 byte sequences in commit messages.
# Default: true
no_bad_runes: true
# no_emoji: 커밋 메시지에서 이모지 사용 금지 여부 (기본값: false).
# true이면 커밋 메시지에 이모지 문자가 포함된 경우 에러로 보고.
# no_emoji: false
# locale: BCP 47 locale for locale-specific ambiguous character detection.
# Supported: ko, ja, zh-hans, zh-hant, ru, _default
# Default: ko
locale: ko
# conventional_commit: enforce Conventional Commits format (https://www.conventionalcommits.org/).
# Format: <type>[(<scope>)][!]: <description>
conventional_commit:
# enabled: true to enforce conventional commit format.
# Default: false
enabled: true
# types: allowed commit types.
# Default: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
# types:
# - feat
# - fix
# - docs
# - chore
# require_scope: require a scope in parentheses, e.g. feat(auth): ...
# Default: false
# require_scope: false
# allow_merge_commits: skip format check for "Merge ..." commits.
# Default: true
# allow_merge_commits: true
# allow_revert_commits: skip format check for "Revert ..." commits.
# Default: true
# allow_revert_commits: true
# language_check: check that the commit message is written in the required language.
language_check:
# enabled: true to enable language checking of commit messages.
# Default: false
enabled: false
# required_language: the natural language the commit message must be in.
# Values: korean | english | japanese | chinese | any
# Default: korean
required_language: korean
# min_length: minimum letter count before a line is language-checked.
# Default: 5
min_length: 5
# skip_prefixes: subject line prefixes that bypass language checking.
# Default: Merge, Revert, fixup!, squash!
skip_prefixes:
- "Merge"
- "Revert"
- "fixup!"
- "squash!"
# In-code directives (all languages — Go, TypeScript, Python, Java, etc.)
# Add these in comments inside source files to control language checking locally:
#
# commit-checker:ignore skip the immediately following comment
# commit-checker:disable disable language check from this line
# commit-checker:disable:lang=<L> disable default; use language L in this region
# commit-checker:enable re-enable after a disable
# commit-checker:lang=<L> switch required language from this point
# commit-checker:file-lang=<L> set required language for the whole file
#
# <L> accepts: korean, english, japanese, chinese, any (or locale codes ko, en, ja, zh)
#
# Examples:
# // commit-checker:ignore
# // This English comment is intentional
#
# // commit-checker:file-lang=english ← at top of file for i18n files
#
# // commit-checker:disable:lang=english
# // This block uses English on purpose
# // commit-checker:enable
# exceptions: global and per-feature file exclusion patterns.
# exceptions:
# global_ignore:
# - "vendor/**"
# - "third_party/**"
# comment_language_ignore:
# - "legacy/**"
# - "*.generated.go"