schema

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedWordsCacheConfig

type AllowedWordsCacheConfig struct {
	Enabled *bool  `yaml:"enabled"`
	TTL     string `yaml:"ttl"`
	Dir     string `yaml:"dir"`
}

AllowedWordsCacheConfig: URL 캐싱 설정 (v1.1.0+).

type BinaryFileConfig

type BinaryFileConfig struct {
	Enabled     *bool    `yaml:"enabled"`
	IgnoreFiles []string `yaml:"ignore_files"`
}

BinaryFileConfig: 바이너리 파일 감지 설정 (v1.0.1+).

type CommentLanguageConfigCurrent

type CommentLanguageConfigCurrent struct {
	Enabled              *bool                   `yaml:"enabled"`
	RequiredLanguage     string                  `yaml:"required_language"`
	Languages            []string                `yaml:"languages"`
	Extensions           []string                `yaml:"extensions"`
	MinLength            int                     `yaml:"min_length"`
	SkipDirectives       []string                `yaml:"skip_directives"`
	CheckMode            string                  `yaml:"check_mode"`
	IgnoreFiles          []string                `yaml:"ignore_files"`
	Locale               string                  `yaml:"locale"`
	FileLanguages        []FileLanguageRule      `yaml:"file_languages"`
	NoEmoji              *bool                   `yaml:"no_emoji"`
	CheckStrings         *bool                   `yaml:"check_strings"`
	SkipTechnicalStrings *bool                   `yaml:"skip_technical_strings"`
	AllowedWords         []string                `yaml:"allowed_words"`
	AllowedWordsFile     string                  `yaml:"allowed_words_file"`
	AllowedWordsURL      string                  `yaml:"allowed_words_url"`
	AllowedWordsCache    AllowedWordsCacheConfig `yaml:"allowed_words_cache"`
}

CommentLanguageConfigCurrent: v1.1.0+ 주석 언어 검사 설정.

type CommentLanguageConfigV100

type CommentLanguageConfigV100 struct {
	Enabled              *bool              `yaml:"enabled"`
	RequiredLanguage     string             `yaml:"required_language"`
	Languages            []string           `yaml:"languages"`
	Extensions           []string           `yaml:"extensions"`
	MinLength            int                `yaml:"min_length"`
	SkipDirectives       []string           `yaml:"skip_directives"`
	CheckMode            string             `yaml:"check_mode"`
	IgnoreFiles          []string           `yaml:"ignore_files"`
	Locale               string             `yaml:"locale"`
	FileLanguages        []FileLanguageRule `yaml:"file_languages"`
	CheckStrings         *bool              `yaml:"check_strings"`
	SkipTechnicalStrings *bool              `yaml:"skip_technical_strings"`
}

CommentLanguageConfigV100: v1.0.0 주석 언어 검사 설정. no_emoji, allowed_words 미지원.

type CommentLanguageConfigV101

type CommentLanguageConfigV101 struct {
	Enabled              *bool              `yaml:"enabled"`
	RequiredLanguage     string             `yaml:"required_language"`
	Languages            []string           `yaml:"languages"`
	Extensions           []string           `yaml:"extensions"`
	MinLength            int                `yaml:"min_length"`
	SkipDirectives       []string           `yaml:"skip_directives"`
	CheckMode            string             `yaml:"check_mode"`
	IgnoreFiles          []string           `yaml:"ignore_files"`
	Locale               string             `yaml:"locale"`
	FileLanguages        []FileLanguageRule `yaml:"file_languages"`
	NoEmoji              *bool              `yaml:"no_emoji"`
	CheckStrings         *bool              `yaml:"check_strings"`
	SkipTechnicalStrings *bool              `yaml:"skip_technical_strings"`
}

CommentLanguageConfigV101: v1.0.1 주석 언어 검사 설정. no_emoji 추가, allowed_words 미지원.

type CommentLanguageConfigV102

type CommentLanguageConfigV102 struct {
	Enabled              *bool              `yaml:"enabled"`
	RequiredLanguage     string             `yaml:"required_language"`
	Languages            []string           `yaml:"languages"`
	Extensions           []string           `yaml:"extensions"`
	MinLength            int                `yaml:"min_length"`
	SkipDirectives       []string           `yaml:"skip_directives"`
	CheckMode            string             `yaml:"check_mode"`
	IgnoreFiles          []string           `yaml:"ignore_files"`
	Locale               string             `yaml:"locale"`
	FileLanguages        []FileLanguageRule `yaml:"file_languages"`
	NoEmoji              *bool              `yaml:"no_emoji"`
	CheckStrings         *bool              `yaml:"check_strings"`
	SkipTechnicalStrings *bool              `yaml:"skip_technical_strings"`
}

CommentLanguageConfigV102: v1.0.2~v1.0.4 주석 언어 검사 설정. allowed_words 관련 필드 없음.

type CommitMessageConfigCurrent

type CommitMessageConfigCurrent struct {
	Enabled              *bool                       `yaml:"enabled"`
	NoAICoauthor         *bool                       `yaml:"no_ai_coauthor"`
	CoauthorRemoveEmails []string                    `yaml:"coauthor_remove_emails"`
	NoUnicodeSpaces      *bool                       `yaml:"no_unicode_spaces"`
	NoAmbiguousChars     *bool                       `yaml:"no_ambiguous_chars"`
	NoBadRunes           *bool                       `yaml:"no_bad_runes"`
	NoEmoji              *bool                       `yaml:"no_emoji"`
	Locale               string                      `yaml:"locale"`
	LanguageCheck        CommitMessageLanguageConfig `yaml:"language_check"`
	ConventionalCommit   ConventionalCommitConfig    `yaml:"conventional_commit"`
}

CommitMessageConfigCurrent: v1.0.2+ 커밋 메시지 검사 설정.

type CommitMessageConfigV100

type CommitMessageConfigV100 struct {
	NoCoauthor           *bool                        `yaml:"no_coauthor"`
	CoauthorRemoveEmails []string                     `yaml:"coauthor_remove_emails"`
	NoUnicodeSpaces      *bool                        `yaml:"no_unicode_spaces"`
	NoAmbiguousChars     *bool                        `yaml:"no_ambiguous_chars"`
	NoBadRunes           *bool                        `yaml:"no_bad_runes"`
	Locale               string                       `yaml:"locale"`
	LanguageCheck        CommitMessageLanguageConfig  `yaml:"language_check"`
	ConventionalCommit   ConventionalCommitConfigV100 `yaml:"conventional_commit"`
}

CommitMessageConfigV100: v1.0.0 커밋 메시지 검사 설정. no_coauthor 사용 (no_ai_coauthor 이전), enabled/no_emoji 미지원.

type CommitMessageConfigV101

type CommitMessageConfigV101 struct {
	Enabled              *bool                       `yaml:"enabled"`
	NoCoauthor           *bool                       `yaml:"no_coauthor"`
	CoauthorRemoveEmails []string                    `yaml:"coauthor_remove_emails"`
	NoUnicodeSpaces      *bool                       `yaml:"no_unicode_spaces"`
	NoAmbiguousChars     *bool                       `yaml:"no_ambiguous_chars"`
	NoBadRunes           *bool                       `yaml:"no_bad_runes"`
	NoEmoji              *bool                       `yaml:"no_emoji"`
	Locale               string                      `yaml:"locale"`
	LanguageCheck        CommitMessageLanguageConfig `yaml:"language_check"`
	ConventionalCommit   ConventionalCommitConfig    `yaml:"conventional_commit"`
}

CommitMessageConfigV101: v1.0.1 커밋 메시지 검사 설정. no_coauthor 사용 (no_ai_coauthor 이전), enabled/no_emoji 추가.

type CommitMessageLanguageConfig

type CommitMessageLanguageConfig struct {
	Enabled          *bool    `yaml:"enabled"`
	RequiredLanguage string   `yaml:"required_language"`
	MinLength        int      `yaml:"min_length"`
	SkipPrefixes     []string `yaml:"skip_prefixes"`
}

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

type ConfigCurrent

type ConfigCurrent struct {
	CommentLanguage CommentLanguageConfigCurrent `yaml:"comment_language"`
	CommitMessage   CommitMessageConfigCurrent   `yaml:"commit_message"`
	BinaryFile      BinaryFileConfig             `yaml:"binary_file"`
	Lint            LintConfig                   `yaml:"lint"`
	Encoding        EncodingConfigCurrent        `yaml:"encoding"`
	EditorConfig    EditorConfigConfig           `yaml:"editorconfig"`
	Exceptions      ExceptionsConfig             `yaml:"exceptions"`
}

ConfigCurrent: v1.1.0+ 설정 스키마.

type ConfigV100

type ConfigV100 struct {
	CommentLanguage CommentLanguageConfigV100 `yaml:"comment_language"`
	CommitMessage   CommitMessageConfigV100   `yaml:"commit_message"`
	Exceptions      ExceptionsConfig          `yaml:"exceptions"`
}

ConfigV100: v1.0.0 설정 스키마. commit_message.no_coauthor 사용, binary_file/lint/encoding/editorconfig 미지원.

type ConfigV101

type ConfigV101 struct {
	CommentLanguage CommentLanguageConfigV101 `yaml:"comment_language"`
	CommitMessage   CommitMessageConfigV101   `yaml:"commit_message"`
	BinaryFile      BinaryFileConfig          `yaml:"binary_file"`
	Lint            LintConfig                `yaml:"lint"`
	Encoding        EncodingConfigV101        `yaml:"encoding"`
	EditorConfig    EditorConfigConfig        `yaml:"editorconfig"`
	Exceptions      ExceptionsConfig          `yaml:"exceptions"`
}

ConfigV101: v1.0.1 설정 스키마. commit_message.no_coauthor 사용, binary_file/lint/encoding/editorconfig 지원 추가. no_emoji 추가, type_aliases/locale 추가.

type ConfigV102

type ConfigV102 struct {
	CommentLanguage CommentLanguageConfigV102  `yaml:"comment_language"`
	CommitMessage   CommitMessageConfigCurrent `yaml:"commit_message"`
	BinaryFile      BinaryFileConfig           `yaml:"binary_file"`
	Lint            LintConfig                 `yaml:"lint"`
	Encoding        EncodingConfigV101         `yaml:"encoding"`
	EditorConfig    EditorConfigConfig         `yaml:"editorconfig"`
	Exceptions      ExceptionsConfig           `yaml:"exceptions"`
}

ConfigV102: v1.0.2~v1.0.4 설정 스키마. no_ai_coauthor 사용, allowed_words/encoding unicode 미지원.

type ConventionalCommitConfig

type ConventionalCommitConfig struct {
	Enabled            *bool             `yaml:"enabled"`
	Types              []string          `yaml:"types"`
	TypeAliases        map[string]string `yaml:"type_aliases"`
	Locale             string            `yaml:"locale"`
	RequireScope       *bool             `yaml:"require_scope"`
	AllowMergeCommits  *bool             `yaml:"allow_merge_commits"`
	AllowRevertCommits *bool             `yaml:"allow_revert_commits"`
}

ConventionalCommitConfig: 컨벤셔널 커밋 형식 설정 (v1.0.1+).

type ConventionalCommitConfigV100

type ConventionalCommitConfigV100 struct {
	Enabled            *bool    `yaml:"enabled"`
	Types              []string `yaml:"types"`
	RequireScope       *bool    `yaml:"require_scope"`
	AllowMergeCommits  *bool    `yaml:"allow_merge_commits"`
	AllowRevertCommits *bool    `yaml:"allow_revert_commits"`
}

ConventionalCommitConfigV100: v1.0.0 컨벤셔널 커밋 설정. type_aliases, locale 미지원.

type EditorConfigConfig

type EditorConfigConfig struct {
	Enabled     *bool    `yaml:"enabled"`
	IgnoreFiles []string `yaml:"ignore_files"`
}

EditorConfigConfig: EditorConfig 검사 설정 (v1.0.1+).

type EncodingConfigCurrent

type EncodingConfigCurrent struct {
	Enabled          *bool    `yaml:"enabled"`
	RequireUTF8      *bool    `yaml:"require_utf8"`
	NoInvisibleChars *bool    `yaml:"no_invisible_chars"`
	NoAmbiguousChars *bool    `yaml:"no_ambiguous_chars"`
	Locale           string   `yaml:"locale"`
	IgnoreFiles      []string `yaml:"ignore_files"`
}

EncodingConfigCurrent: v1.1.0+ 인코딩 설정.

type EncodingConfigV101

type EncodingConfigV101 struct {
	Enabled     *bool    `yaml:"enabled"`
	RequireUTF8 *bool    `yaml:"require_utf8"`
	IgnoreFiles []string `yaml:"ignore_files"`
}

EncodingConfigV101: v1.0.1 인코딩 설정. no_invisible_chars, no_ambiguous_chars, locale 미지원.

type ExceptionsConfig

type ExceptionsConfig struct {
	GlobalIgnore          []string `yaml:"global_ignore"`
	CommentLanguageIgnore []string `yaml:"comment_language_ignore"`
}

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

type FileLanguageRule

type FileLanguageRule struct {
	Pattern  string `yaml:"pattern"`
	Language string `yaml:"language"`
}

FileLanguageRule: 파일별 언어 규칙 (glob 패턴 → 언어 매핑).

type JSONLintConfig

type JSONLintConfig struct {
	Enabled     *bool    `yaml:"enabled"`
	AllowJSON5  *bool    `yaml:"allow_json5"`
	IgnoreFiles []string `yaml:"ignore_files"`
}

JSONLintConfig: JSON lint 설정.

type LintConfig

type LintConfig struct {
	Enabled *bool          `yaml:"enabled"`
	YAML    LintRuleConfig `yaml:"yaml"`
	JSON    JSONLintConfig `yaml:"json"`
	XML     LintRuleConfig `yaml:"xml"`
}

LintConfig: 데이터 파일 lint 설정 (v1.0.1+).

type LintRuleConfig

type LintRuleConfig struct {
	Enabled     *bool    `yaml:"enabled"`
	IgnoreFiles []string `yaml:"ignore_files"`
}

LintRuleConfig: 단일 lint 규칙 설정.

type MigrateResult

type MigrateResult struct {
	// DetectedVersion: 감지된 설정 파일의 스키마 버전.
	DetectedVersion Version
	// Applied: 적용된 마이그레이션 규칙 설명 목록.
	Applied []string
	// Data: 마이그레이션된 YAML 데이터.
	Data []byte
}

MigrateResult: 마이그레이션 결과.

func Migrate

func Migrate(data []byte) (*MigrateResult, error)

Migrate: YAML 데이터를 현재 스키마로 마이그레이션. 이미 최신이면 Applied가 빈 슬라이스.

type MigrationRule

type MigrationRule struct {
	// Description: 사람이 읽을 수 있는 변경 사항 설명.
	Description string
	// Apply: YAML 텍스트에 변환을 적용하고 변경된 텍스트를 반환.
	Apply func(data []byte) []byte
}

MigrationRule: 단일 마이그레이션 규칙.

type Version

type Version string

Version: 감지된 설정 파일의 스키마 버전.

const (
	VersionCurrent Version = "v1.1.0" // v1.1.0+ (현재: allowed_words, encoding unicode)
	VersionV102    Version = "v1.0.2" // v1.0.2~v1.0.4 (no_ai_coauthor, allowed_words 없음)
	VersionV101    Version = "v1.0.1" // v1.0.1 (no_coauthor, 전체 섹션)
	VersionV100    Version = "v1.0.0" // v1.0.0 (no_coauthor, 최소 섹션)
	VersionUnknown Version = "unknown"
)

func DetectVersion

func DetectVersion(data []byte) Version

DetectVersion: YAML 데이터의 스키마 버전을 감지. 구 버전부터 순서대로 strict 파싱을 시도하여 첫 번째 성공한 버전을 반환. 상위 호환(superset) 관계에서는 YAML 필드 존재 여부로 추가 판별.

Jump to

Keyboard shortcuts

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