config

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuiltinAICoauthorPatterns = []string{
	"*copilot*@*",
	"noreply@anthropic.com",
	"*@cursor.sh",
	"*@codeium.com",
	"*@tabnine.com",
	"*amazon-q*@*",
	"*@sourcegraph.com",
	"*gemini*@*",
}

BuiltinAICoauthorPatterns: 내장 AI 도구 이메일 glob 패턴 목록. GitHub Copilot, Claude, Cursor, Codeium, Tabnine, Amazon Q 등 주요 AI 도구를 대상으로 함.

View Source
var DefaultConventionalTypes = []string{
	"feat", "fix", "docs", "style", "refactor",
	"perf", "test", "build", "ci", "chore", "revert",
}

DefaultConventionalTypes: 기본 허용 커밋 타입 목록.

View Source
var LocalizedConventionalTypes = map[string]map[string]string{
	"ko": {
		"기능":   "feat",
		"수정":   "fix",
		"문서":   "docs",
		"스타일":  "style",
		"리팩터":  "refactor",
		"리팩토링": "refactor",
		"성능":   "perf",
		"테스트":  "test",
		"빌드":   "build",
		"배포":   "ci",
		"잡일":   "chore",
		"되돌리기": "revert",
	},
	"ja": {
		"機能":       "feat",
		"修正":       "fix",
		"ドキュメント":   "docs",
		"スタイル":     "style",
		"リファクタリング": "refactor",
		"パフォーマンス":  "perf",
		"テスト":      "test",
		"ビルド":      "build",
		"デプロイ":     "ci",
		"雑務":       "chore",
		"リバート":     "revert",
	},
	"zh": {
		"功能": "feat",
		"修复": "fix",
		"文档": "docs",
		"样式": "style",
		"重构": "refactor",
		"性能": "perf",
		"测试": "test",
		"构建": "build",
		"部署": "ci",
		"杂务": "chore",
		"回退": "revert",
	},
}

LocalizedConventionalTypes: 언어별 컨벤셔널 커밋 타입 매핑. key: 로컬라이즈된 타입, value: 표준 타입.

Functions

func ExtractCoauthorEmail

func ExtractCoauthorEmail(line string) string

ExtractCoauthorEmail: Co-authored-by: 트레일러에서 이메일 주소를 추출. 꺾쇠 괄호 없이 반환. 이메일이 없으면 빈 문자열 반환.

func Validate added in v1.2.0

func Validate(cfg *Config, cfgPath string) []string

Validate: 설정 값의 유효성을 검사하고 경고 메시지 목록을 반환. 오류가 아닌 경고이므로 Load()가 실패하지 않음.

Types

type AllowedWordsCacheConfig added in v1.1.0

type AllowedWordsCacheConfig struct {
	// Enabled: 캐싱 활성화 여부 (기본값: false).
	Enabled *bool `yaml:"enabled"`

	// TTL: 캐시 유효 기간 (기본값: "24h").
	// time.ParseDuration 형식: "1h", "30m", "24h" 등.
	TTL string `yaml:"ttl"`

	// Dir: 캐시 디렉터리 경로 (기본값: ~/.cache/commit-checker).
	Dir string `yaml:"dir"`
}

AllowedWordsCacheConfig: allowed_words_url 캐싱 설정.

func (*AllowedWordsCacheConfig) GetDir added in v1.1.0

func (c *AllowedWordsCacheConfig) GetDir() string

GetDir: 캐시 디렉터리 경로 반환.

func (*AllowedWordsCacheConfig) GetTTL added in v1.1.0

GetTTL: 캐시 유효 기간 반환 (기본값: 24h).

func (*AllowedWordsCacheConfig) IsEnabled added in v1.1.0

func (c *AllowedWordsCacheConfig) IsEnabled() bool

IsEnabled: 캐싱 활성화 여부 반환 (기본값: false).

type BinaryFileConfig added in v1.0.1

type BinaryFileConfig struct {
	// Enabled: 바이너리 파일 감지 활성화 여부 (기본값: true).
	Enabled *bool `yaml:"enabled"`

	// IgnoreFiles: 허용할 바이너리 파일의 glob 패턴 목록.
	// 예: 이미지, 폰트 등 의도적으로 포함하는 바이너리 파일.
	IgnoreFiles []string `yaml:"ignore_files"`
}

BinaryFileConfig: 스테이지된 diff에서 바이너리 파일 감지 설정. 컴파일된 실행파일 등 바이너리 파일이 커밋되는 것을 방지.

func (*BinaryFileConfig) IsEnabled added in v1.0.1

func (c *BinaryFileConfig) IsEnabled() bool

IsEnabled: 바이너리 파일 감지 활성화 여부 반환 (기본값: true).

type BodyLineLimitConfig added in v1.2.0

type BodyLineLimitConfig struct {
	// Enabled: 본문 줄 길이 검사 활성화 여부 (기본값: false).
	Enabled *bool `yaml:"enabled"`

	// MaxLength: 본문 각 줄 최대 글자 수 (기본값: 100).
	MaxLength int `yaml:"max_length"`
}

BodyLineLimitConfig: 커밋 메시지 본문 줄 길이 제한 설정.

func (*BodyLineLimitConfig) GetMaxLength added in v1.2.0

func (c *BodyLineLimitConfig) GetMaxLength() int

GetMaxLength: 본문 각 줄 최대 글자 수 반환 (기본값: 100).

func (*BodyLineLimitConfig) IsEnabled added in v1.2.0

func (c *BodyLineLimitConfig) IsEnabled() bool

IsEnabled: 본문 줄 길이 검사 활성화 여부 반환 (기본값: false).

type CommentLanguageConfig

type CommentLanguageConfig struct {
	// Enabled: 주석 언어 검사 활성화 여부 (기본값: true).
	Enabled *bool `yaml:"enabled"`

	// RequiredLanguage: 주석을 작성해야 하는 자연어.
	// 지원값: korean, english, japanese, chinese, any
	// 기본값: korean
	RequiredLanguage string `yaml:"required_language"`

	// Languages: 파싱할 언어 이름 목록 (예: go, typescript, python).
	// 설정 시 해당 파서만 실행되며 Extensions보다 우선함.
	// 지원: go, typescript, javascript, java, kotlin, python, c, cpp, csharp, swift, rust
	Languages []string `yaml:"languages"`

	// Extensions: 검사할 파일 확장자 목록.
	// Languages가 설정되지 않은 경우 사용.
	Extensions []string `yaml:"extensions"`

	// MinLength: 언어 검사 전 주석이 가져야 할 최소 글자 수.
	// 짧거나 기술적인 주석은 건너뜀.
	// 기본값: 5
	MinLength int `yaml:"min_length"`

	// SkipDirectives: 항상 건너뛸 추가 주석 접두사 목록.
	// 내장 건너뜀: todo, fixme, nolint, noqa, go:generate 등.
	SkipDirectives []string `yaml:"skip_directives"`

	// CheckMode: 추가된 줄만("diff") 또는 전체 스테이지 파일("full")을 검사할지 제어.
	// 기본값: diff
	CheckMode string `yaml:"check_mode"`

	// IgnoreFiles: 주석 언어 검사에서 건너뛸 파일의 glob 패턴 목록.
	// exceptions.comment_language_ignore에 패턴을 추가하는 것과 동일.
	IgnoreFiles []string `yaml:"ignore_files"`

	// Locale: 필수 언어를 자동으로 설정하는 BCP-47 로케일 코드.
	// 지원: ko (korean), en (english), ja (japanese), zh / zh-hans / zh-hant (chinese).
	// 설정 시 RequiredLanguage를 재정의함.
	Locale string `yaml:"locale"`

	// FileLanguages: 순서대로 적용되는 파일별 언어 규칙.
	// 첫 번째 일치 패턴이 적용되며 전역 RequiredLanguage를 재정의함.
	// 모든 언어를 허용하려면 language를 "any"로 설정 (예: i18n/locale 파일).
	FileLanguages []FileLanguageRule `yaml:"file_languages"`

	// NoEmoji: 주석에서 이모지 사용 금지 여부 (기본값: false).
	// true이면 소스 코드 주석에 이모지 사용을 금지.
	NoEmoji *bool `yaml:"no_emoji"`

	// CheckStrings: 문자열 리터럴도 주석과 동일하게 언어 검사 여부 (기본값: false).
	// true 로 설정하면 소스 코드 내 문자열 리터럴에도 required_language 가 적용됨.
	CheckStrings *bool `yaml:"check_strings"`

	// SkipTechnicalStrings: check_strings=true 일 때 기술적 식별자로 판단되는 문자열을 건너뜀 (기본값: true).
	// 건너뜀 조건:
	//   - 슬래시(/) 포함 → 경로 또는 MIME 타입 (예: /api/v1, application/json)
	//   - 소문자 없는 순수 ASCII → 대문자 상수 (예: ERR_TOKEN, MAX_SIZE)
	// false 로 설정하면 모든 문자열을 언어 검사함.
	SkipTechnicalStrings *bool `yaml:"skip_technical_strings"`

	// AllowedWords: 언어 검사에서 무시할 영어 단어 목록.
	// 주석에서 해당 단어를 제거한 후 나머지 텍스트로 언어를 판별합니다.
	// 고유명사, 기술 용어 등에 활용합니다.
	// 예: TypeScript, JavaScript, API, URL
	AllowedWords []string `yaml:"allowed_words"`

	// AllowedWordsFile: 허용 단어가 한 줄에 하나씩 적힌 텍스트 파일 경로.
	// allowed_words와 병합됩니다. 줄 단위로 읽으며 # 로 시작하는 줄은 주석으로 무시합니다.
	AllowedWordsFile string `yaml:"allowed_words_file"`

	// AllowedWordsURL: 허용 단어 파일을 HTTP/HTTPS로 가져올 URL.
	// allowed_words, allowed_words_file과 병합됩니다.
	// 형식은 allowed_words_file과 동일합니다 (줄 단위, # 주석).
	AllowedWordsURL string `yaml:"allowed_words_url"`

	// AllowedWordsCache: URL에서 가져온 허용 단어의 로컬 캐싱 설정.
	AllowedWordsCache AllowedWordsCacheConfig `yaml:"allowed_words_cache"`
}

CommentLanguageConfig: 스테이지된 diff의 주석 언어 검사 설정.

func (*CommentLanguageConfig) IsCheckStrings

func (c *CommentLanguageConfig) IsCheckStrings() bool

IsCheckStrings 는 문자열 리터럴 언어 검사가 활성화된 경우 true 반환 (기본값: false).

func (*CommentLanguageConfig) IsEnabled

func (c *CommentLanguageConfig) IsEnabled() bool

IsEnabled: 주석 언어 검사 활성화 여부 반환 (기본값: true).

func (*CommentLanguageConfig) IsFullMode

func (c *CommentLanguageConfig) IsFullMode() bool

IsFullMode: check_mode가 "full"일 때 true 반환 (전체 스테이지 파일 주석 검사).

func (*CommentLanguageConfig) IsNoEmoji added in v1.0.1

func (c *CommentLanguageConfig) IsNoEmoji() bool

IsNoEmoji: 주석 이모지 검사 활성화 여부 반환 (기본값: false).

func (*CommentLanguageConfig) IsSkipTechnicalStrings

func (c *CommentLanguageConfig) IsSkipTechnicalStrings() bool

IsSkipTechnicalStrings 는 기술적 식별자 문자열을 건너뛰는 경우 true 반환 (기본값: true).

type CommitMessageConfig

type CommitMessageConfig struct {
	// Enabled: 커밋 메시지 검사 전체 활성화 여부 (기본값: true).
	// false이면 no_ai_coauthor, no_unicode_spaces 등 모든 하위 검사를 건너뜀.
	Enabled *bool `yaml:"enabled"`

	// NoAICoauthor: AI 도구의 Co-authored-by: 트레일러를 차단 (기본값: true).
	// true이면 내장 AI 이메일 패턴 목록과 일치하는 Co-authored-by 줄을 거부/제거.
	// 일반 사람 공동 작업자는 영향을 받지 않음.
	NoAICoauthor *bool `yaml:"no_ai_coauthor"`

	// CoauthorRemoveEmails: 내장 AI 패턴에 추가로 제거할 이메일 주소 또는 glob 패턴 목록.
	// '*' 와일드카드 지원 (예: "*@myai.com"), 대소문자 무시.
	// 내장 패턴: *copilot*, noreply@anthropic.com, *@cursor.sh, *@codeium.com 등.
	CoauthorRemoveEmails []string `yaml:"coauthor_remove_emails"`

	// NoUnicodeSpaces: 보이지 않는/비표준 유니코드 공백 문자 금지 여부 (기본값: true).
	// Gitea와 동일한 InvisibleRanges 테이블 사용. BOM (U+FEFF)은 제외.
	NoUnicodeSpaces *bool `yaml:"no_unicode_spaces"`

	// NoAmbiguousChars: ASCII처럼 보이지만 아닌 유니코드 문자 금지 여부 (기본값: true).
	// Gitea와 동일한 AmbiguousCharacters 테이블 사용 (VSCode 유니코드 데이터 소스).
	// 예: 키릴 А (U+0410)는 라틴 A처럼; 그리스 ο는 라틴 o처럼 보임.
	NoAmbiguousChars *bool `yaml:"no_ambiguous_chars"`

	// NoBadRunes: 잘못된 UTF-8 바이트 시퀀스 금지 여부 (기본값: true).
	NoBadRunes *bool `yaml:"no_bad_runes"`

	// NoEmoji: 커밋 메시지에서 이모지 사용 금지 여부 (기본값: false).
	// true이면 커밋 메시지에 이모지 사용을 금지.
	NoEmoji *bool `yaml:"no_emoji"`

	// Locale: 로케일별 모호 문자 감지에 사용되는 BCP-47 로케일 코드.
	// 지원: ko, ja, zh-hans, zh-hant, ru, _default
	// 기본값: ko
	Locale string `yaml:"locale"`

	// LanguageCheck: 커밋 메시지 본문의 자연어 감지 설정.
	LanguageCheck CommitMessageLanguageConfig `yaml:"language_check"`

	// ConventionalCommit: Conventional Commits 형식 강제 설정.
	ConventionalCommit ConventionalCommitConfig `yaml:"conventional_commit"`

	// SubjectLimit: 커밋 메시지 제목(첫 번째 줄) 글자 수 제한.
	SubjectLimit SubjectLimitConfig `yaml:"subject_limit"`

	// BodyLineLimit: 커밋 메시지 본문 각 줄의 글자 수 제한.
	BodyLineLimit BodyLineLimitConfig `yaml:"body_line_limit"`
}

CommitMessageConfig: 커밋 메시지 검사 설정.

func (*CommitMessageConfig) CoauthorShouldRemove

func (c *CommitMessageConfig) CoauthorShouldRemove(email string) bool

CoauthorShouldRemove: 주어진 이메일이 내장 AI 패턴 또는 사용자 정의 패턴과 일치하는지 확인. 일치하면 해당 Co-authored-by 줄을 제거해야 함을 의미.

func (*CommitMessageConfig) IsEnabled added in v1.0.1

func (c *CommitMessageConfig) IsEnabled() bool

IsEnabled: 커밋 메시지 검사 전체 활성화 여부 반환 (기본값: true).

func (*CommitMessageConfig) IsNoAICoauthor added in v1.0.2

func (c *CommitMessageConfig) IsNoAICoauthor() bool

IsNoAICoauthor: 공동 작성자 검사 활성화 여부 반환 (기본값: true).

func (*CommitMessageConfig) IsNoAmbiguousChars

func (c *CommitMessageConfig) IsNoAmbiguousChars() bool

IsNoAmbiguousChars: 모호한 문자 검사 활성화 여부 반환 (기본값: true).

func (*CommitMessageConfig) IsNoBadRunes

func (c *CommitMessageConfig) IsNoBadRunes() bool

IsNoBadRunes: 잘못된 UTF-8 룬 검사 활성화 여부 반환 (기본값: true).

func (*CommitMessageConfig) IsNoEmoji added in v1.0.1

func (c *CommitMessageConfig) IsNoEmoji() bool

IsNoEmoji: 커밋 메시지 이모지 검사 활성화 여부 반환 (기본값: false).

func (*CommitMessageConfig) IsNoUnicodeSpaces

func (c *CommitMessageConfig) IsNoUnicodeSpaces() bool

IsNoUnicodeSpaces: 유니코드 공백 검사 활성화 여부 반환 (기본값: true).

type CommitMessageLanguageConfig

type CommitMessageLanguageConfig struct {
	// Enabled: 커밋 메시지 언어 검사 활성화 여부 (기본값: false).
	Enabled *bool `yaml:"enabled"`

	// RequiredLanguage: 커밋 메시지 본문을 작성해야 하는 자연어.
	// 지원값: korean, english, japanese, chinese, any
	// 기본값: korean
	RequiredLanguage string `yaml:"required_language"`

	// MinLength: 언어 검사 전 최소 글자 수.
	// 기본값: 5
	MinLength int `yaml:"min_length"`

	// SkipPrefixes: 언어 검사를 건너뛸 커밋 메시지 제목 접두사 목록.
	// 기본값: Merge, Revert, fixup!, squash!
	SkipPrefixes []string `yaml:"skip_prefixes"`
}

CommitMessageLanguageConfig: 커밋 메시지 본문의 자연어 검사 설정.

func (*CommitMessageLanguageConfig) IsEnabled

func (c *CommitMessageLanguageConfig) IsEnabled() bool

IsEnabled: 커밋 메시지 언어 검사 활성화 여부 반환 (기본값: false).

type Config

type Config struct {
	CommentLanguage CommentLanguageConfig `yaml:"comment_language"`
	CommitMessage   CommitMessageConfig   `yaml:"commit_message"`
	BinaryFile      BinaryFileConfig      `yaml:"binary_file"`
	Lint            LintConfig            `yaml:"lint"`
	Encoding        EncodingConfig        `yaml:"encoding"`
	EditorConfig    EditorConfigConfig    `yaml:"editorconfig"`
	Exceptions      ExceptionsConfig      `yaml:"exceptions"`
	CustomRules     CustomRulesConfig     `yaml:"custom_rules"`
}

Config: .commit-checker.yml에서 로드하는 최상위 설정 구조체.

func Load

func Load(cfgPath string) (*Config, error)

Load: 주어진 YAML 파일에서 설정을 읽음. 전역 설정(~/.commit-checker.yml)이 있으면 먼저 로드하고 프로젝트 설정과 병합합니다. 파일이 없으면 기본 설정을 반환.

type ConventionalCommitConfig

type ConventionalCommitConfig struct {
	// Enabled: 컨벤셔널 커밋 형식 검사 활성화 여부 (기본값: false).
	Enabled *bool `yaml:"enabled"`

	// Types: 허용된 커밋 타입 목록.
	// 기본값: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
	Types []string `yaml:"types"`

	// TypeAliases: 로컬라이즈된 타입 별칭 매핑 (로컬라이즈 -> 표준 타입).
	// 예: {"기능": "feat", "수정": "fix"} (한국어)
	// 설정하면 로컬라이즈된 타입도 허용됨.
	TypeAliases map[string]string `yaml:"type_aliases"`

	// Locale: 로컬라이즈된 타입 기본값을 적용할 언어.
	// type_aliases가 설정되지 않은 경우 내장 매핑을 사용.
	// 지원: ko, ja, zh
	Locale string `yaml:"locale"`

	// RequireScope: 스코프 필수 여부 (기본값: false).
	RequireScope *bool `yaml:"require_scope"`

	// AllowMergeCommits: "Merge "로 시작하는 커밋의 형식 검사 건너뜀 (기본값: true).
	AllowMergeCommits *bool `yaml:"allow_merge_commits"`

	// AllowRevertCommits: "Revert "로 시작하는 커밋의 형식 검사 건너뜀 (기본값: true).
	AllowRevertCommits *bool `yaml:"allow_revert_commits"`
}

ConventionalCommitConfig: Conventional Commits 형식 강제 설정. 명세: https://www.conventionalcommits.org/

func (*ConventionalCommitConfig) GetAllAllowedTypes added in v1.0.1

func (c *ConventionalCommitConfig) GetAllAllowedTypes() []string

GetAllAllowedTypes: 허용된 모든 타입 목록을 반환 (표준 + 별칭).

func (*ConventionalCommitConfig) GetTypeAliases added in v1.0.1

func (c *ConventionalCommitConfig) GetTypeAliases() map[string]string

GetTypeAliases: 타입 별칭 매핑을 반환. 사용자 설정 > 로케일 내장 매핑 > 빈 map 순서로 적용.

func (*ConventionalCommitConfig) GetTypes

func (c *ConventionalCommitConfig) GetTypes() []string

GetTypes: 설정된 타입 목록을 반환하며, 미설정 시 DefaultConventionalTypes 반환.

func (*ConventionalCommitConfig) IsAllowMergeCommits

func (c *ConventionalCommitConfig) IsAllowMergeCommits() bool

IsAllowMergeCommits: Merge 커밋 형식 검사 건너뜀 여부 반환 (기본값: true).

func (*ConventionalCommitConfig) IsAllowRevertCommits

func (c *ConventionalCommitConfig) IsAllowRevertCommits() bool

IsAllowRevertCommits: Revert 커밋 형식 검사 건너뜀 여부 반환 (기본값: true).

func (*ConventionalCommitConfig) IsEnabled

func (c *ConventionalCommitConfig) IsEnabled() bool

IsEnabled: 컨벤셔널 커밋 검사 활성화 여부 반환 (기본값: false).

func (*ConventionalCommitConfig) IsRequireScope

func (c *ConventionalCommitConfig) IsRequireScope() bool

IsRequireScope: 스코프 필수 여부 반환 (기본값: false).

func (*ConventionalCommitConfig) ResolveType added in v1.0.1

func (c *ConventionalCommitConfig) ResolveType(commitType string) string

ResolveType: 타입 문자열을 표준 타입으로 해석. 별칭이면 표준 타입 반환, 아니면 입력 그대로 반환.

type CustomRule added in v1.2.0

type CustomRule struct {
	// Name: 규칙 이름 (오류 메시지에 표시됨).
	Name string `yaml:"name"`

	// Pattern: Go 정규식 패턴 (regexp.Compile 호환).
	Pattern string `yaml:"pattern"`

	// Message: 규칙 위반 시 표시할 사람이 읽기 쉬운 메시지.
	Message string `yaml:"message"`

	// Required: true이면 패턴이 반드시 일치해야 함 (불일치 시 오류).
	// false(기본값)이면 패턴이 일치하면 안 됨 (일치 시 오류, forbidden 규칙).
	Required bool `yaml:"required"`
}

CustomRule: 정규식 기반 커스텀 검사 규칙.

type CustomRulesConfig added in v1.2.0

type CustomRulesConfig struct {
	// CommitMessage: 커밋 메시지에 적용할 커스텀 규칙 목록.
	CommitMessage []CustomRule `yaml:"commit_message"`

	// Diff: 스테이지된 diff의 추가된 줄에 적용할 커스텀 규칙 목록.
	Diff []CustomRule `yaml:"diff"`
}

CustomRulesConfig: 정규식 기반 커스텀 규칙 설정.

type EditorConfigConfig added in v1.0.1

type EditorConfigConfig struct {
	// Enabled: editorconfig 검사 활성화 여부 (기본값: true).
	Enabled *bool `yaml:"enabled"`

	// IgnoreFiles: editorconfig 검사에서 제외할 파일의 glob 패턴 목록.
	IgnoreFiles []string `yaml:"ignore_files"`
}

EditorConfigConfig: .editorconfig 규칙 검증 설정.

func (*EditorConfigConfig) IsEnabled added in v1.0.1

func (c *EditorConfigConfig) IsEnabled() bool

IsEnabled: editorconfig 검사 활성화 여부 반환 (기본값: true).

type EncodingConfig added in v1.0.1

type EncodingConfig struct {
	// Enabled: 인코딩 검사 활성화 여부 (기본값: true).
	Enabled *bool `yaml:"enabled"`

	// RequireUTF8: UTF-8 인코딩 필수 여부 (기본값: true).
	// true이면 UTF-8이 아닌 파일을 커밋할 수 없음.
	RequireUTF8 *bool `yaml:"require_utf8"`

	// NoInvisibleChars: 파일 내용에서 비가시 유니코드 문자 금지 여부 (기본값: false).
	// NBSP, ZWSP, BiDi 제어 문자 등을 감지.
	NoInvisibleChars *bool `yaml:"no_invisible_chars"`

	// NoAmbiguousChars: 파일 내용에서 ASCII와 혼동되는 유니코드 문자 금지 여부 (기본값: false).
	// 키릴 А (U+0410) vs 라틴 A (U+0041) 등을 감지.
	NoAmbiguousChars *bool `yaml:"no_ambiguous_chars"`

	// Locale: 모호한 문자 감지에 사용할 BCP-47 로케일 코드 (기본값: ko).
	Locale string `yaml:"locale"`

	// IgnoreFiles: 인코딩 검사에서 제외할 파일의 glob 패턴 목록.
	IgnoreFiles []string `yaml:"ignore_files"`
}

EncodingConfig: 파일 인코딩 검사 설정.

func (*EncodingConfig) IsEnabled added in v1.0.1

func (c *EncodingConfig) IsEnabled() bool

IsEnabled: 인코딩 검사 활성화 여부 반환 (기본값: true).

func (*EncodingConfig) IsNoAmbiguousChars added in v1.1.0

func (c *EncodingConfig) IsNoAmbiguousChars() bool

IsNoAmbiguousChars: 모호한 유니코드 문자 검사 활성화 여부 반환 (기본값: false).

func (*EncodingConfig) IsNoInvisibleChars added in v1.1.0

func (c *EncodingConfig) IsNoInvisibleChars() bool

IsNoInvisibleChars: 비가시 유니코드 문자 검사 활성화 여부 반환 (기본값: false).

func (*EncodingConfig) IsRequireUTF8 added in v1.0.1

func (c *EncodingConfig) IsRequireUTF8() bool

IsRequireUTF8: UTF-8 인코딩 필수 여부 반환 (기본값: true).

type ExceptionsConfig

type ExceptionsConfig struct {
	// GlobalIgnore: 모든 검사에서 건너뛸 파일의 glob 패턴 목록.
	GlobalIgnore []string `yaml:"global_ignore"`

	// CommentLanguageIgnore: 주석 언어 검사에서만 건너뛸 파일의 glob 패턴 목록.
	CommentLanguageIgnore []string `yaml:"comment_language_ignore"`
}

ExceptionsConfig: 전역 및 기능별 파일 제외 패턴 설정.

type FileLanguageRule

type FileLanguageRule struct {
	// Pattern: 파일 경로에 대해 매칭되는 glob 패턴 (** 와일드카드 지원).
	Pattern string `yaml:"pattern"`
	// Language: Pattern에 일치하는 파일에 필요한 언어.
	// required_language와 동일한 값 및 로케일 코드 허용.
	Language string `yaml:"language"`
}

FileLanguageRule: glob 패턴을 필수 언어에 매핑하는 규칙.

type JSONLintConfig added in v1.0.1

type JSONLintConfig struct {
	// Enabled: JSON lint 활성화 여부 (기본값: true).
	Enabled *bool `yaml:"enabled"`

	// AllowJSON5: JSON5 형식 허용 여부 (기본값: false).
	// true이면 // 및 /* */ 주석, trailing comma 허용.
	AllowJSON5 *bool `yaml:"allow_json5"`

	// IgnoreFiles: 건너뛸 파일의 glob 패턴 목록.
	// 기본 제외: package-lock.json, yarn.lock 등 auto-generated 파일.
	IgnoreFiles []string `yaml:"ignore_files"`
}

JSONLintConfig: JSON lint 검사 설정.

func (*JSONLintConfig) IsAllowJSON5 added in v1.0.1

func (c *JSONLintConfig) IsAllowJSON5() bool

IsAllowJSON5: JSON5 형식 허용 여부 반환 (기본값: false).

func (*JSONLintConfig) IsEnabled added in v1.0.1

func (c *JSONLintConfig) IsEnabled() bool

IsEnabled: JSON lint 활성화 여부 반환 (기본값: true).

type LintConfig added in v1.0.1

type LintConfig struct {
	// Enabled: lint 검사 활성화 여부 (기본값: true).
	Enabled *bool `yaml:"enabled"`

	// YAML lint 설정
	YAML LintRuleConfig `yaml:"yaml"`

	// JSON lint 설정
	JSON JSONLintConfig `yaml:"json"`

	// XML lint 설정
	XML LintRuleConfig `yaml:"xml"`

	// TOML lint 설정
	TOML LintRuleConfig `yaml:"toml"`
}

LintConfig: 데이터 파일(YAML, JSON, XML) 구문 lint 검사 설정.

func (*LintConfig) IsEnabled added in v1.0.1

func (c *LintConfig) IsEnabled() bool

IsEnabled: lint 검사 활성화 여부 반환 (기본값: true).

type LintRuleConfig added in v1.0.1

type LintRuleConfig struct {
	// Enabled: 이 lint 규칙 활성화 여부 (기본값: true).
	Enabled *bool `yaml:"enabled"`

	// IgnoreFiles: 건너뛸 파일의 glob 패턴 목록.
	IgnoreFiles []string `yaml:"ignore_files"`
}

LintRuleConfig: 단일 lint 규칙 타입 설정.

func (*LintRuleConfig) IsEnabled added in v1.0.1

func (c *LintRuleConfig) IsEnabled() bool

IsEnabled: 이 lint 규칙 활성화 여부 반환 (기본값: true).

type SubjectLimitConfig added in v1.2.0

type SubjectLimitConfig struct {
	// Enabled: 제목 길이 검사 활성화 여부 (기본값: false).
	Enabled *bool `yaml:"enabled"`

	// MaxLength: 제목 최대 글자 수 (기본값: 72).
	MaxLength int `yaml:"max_length"`
}

SubjectLimitConfig: 커밋 메시지 제목 글자 수 제한 설정.

func (*SubjectLimitConfig) GetMaxLength added in v1.2.0

func (c *SubjectLimitConfig) GetMaxLength() int

GetMaxLength: 제목 최대 글자 수 반환 (기본값: 72).

func (*SubjectLimitConfig) IsEnabled added in v1.2.0

func (c *SubjectLimitConfig) IsEnabled() bool

IsEnabled: 제목 길이 검사 활성화 여부 반환 (기본값: false).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL