docs

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteYamlRules deprecated

func WriteYamlRules(cfgPath string, triggered []string) error

Deprecated: use AutoRuleSet.Save under .ccg/auto-rules.yaml for generated lint state. WriteYamlRules appends Twice-Rule-triggered entries to .ccg.yaml rules section. Idempotent: skips rules whose pattern already exists in the file. Creates the file if it doesn't exist. @intent 반복 발생 이슈를 설정 파일의 warn 규칙으로 반영한다. @domainRule 이미 존재하는 pattern은 중복 규칙으로 다시 추가하지 않는다. @sideEffect .ccg.yaml 파일을 읽고 rules 섹션을 갱신한다.

Types

type AutoRule

type AutoRule struct {
	Pattern  string `yaml:"pattern"`
	Category string `yaml:"category"`
	Action   string `yaml:"action"`
	Auto     bool   `yaml:"auto"`
	Created  string `yaml:"created,omitempty"`
}

AutoRule stores generated warn-only lint state separate from human policy. @intent Twice Rule이 만든 자동 warn 규칙을 사람이 관리하는 설정 파일과 분리 저장한다.

type AutoRuleSet

type AutoRuleSet struct {
	Rules []AutoRule `yaml:"rules"`
}

AutoRuleSet is the persisted generated-rule document written under .ccg/. @intent generated lint state를 rules YAML shape로 직렬화해 기존 규칙 형태와 호환되게 유지한다.

func LoadAutoRules

func LoadAutoRules(path string) (*AutoRuleSet, error)

LoadAutoRules reads generated auto rules. Missing files return an empty set. @intent generated lint rule 상태 파일이 없을 때도 lint가 정상적으로 동작하게 한다.

func (*AutoRuleSet) Save

func (s *AutoRuleSet) Save(path string) error

Save writes generated auto rules, creating parent dirs if needed. @intent generated lint state를 원자적으로 기록해 수동 정책 파일과 분리 유지한다.

func (*AutoRuleSet) Upsert

func (s *AutoRuleSet) Upsert(triggered []string) []AutoRule

Upsert adds new generated warn rules for triggered lint keys. @intent 같은 category+pattern 규칙을 중복 기록하지 않고 새 자동 규칙만 추가한다.

type Contradiction

type Contradiction struct {
	QualifiedName string
	Detail        string
}

Contradiction represents a symbol whose annotation is outdated relative to the code: the node was modified after the annotation was last written, and the annotation contains detail tags (e.g. @param) that may no longer be accurate. @intent 코드 변경으로 세부 어노테이션 신뢰성이 깨진 심볼을 보고한다.

type DeadRef

type DeadRef struct {
	QualifiedName string // the symbol that contains the @see tag
	SeeTarget     string // the @see value that could not be resolved
}

DeadRef represents an @see tag whose target qualified name does not exist in the graph. This indicates a broken cross-reference that should be updated or removed. @intent 해석되지 않는 @see 참조를 수집해 문서 링크 정합성을 점검한다.

type Generator

type Generator struct {
	DB        *gorm.DB
	OutDir    string
	Exclude   []string // path/glob patterns to exclude (see pathutil.MatchExcludes)
	Namespace string
	Prune     bool
}

Generator reads the SQLite graph and writes markdown documentation. @intent 그래프에 저장된 심볼과 어노테이션을 문서 생성 단계로 전달한다.

func (*Generator) Lint

func (g *Generator) Lint() (*LintReport, error)

Lint checks the documentation directory against the code graph and returns a report of orphan, missing, and stale documentation files. @intent 문서 파일, 그래프 노드, 어노테이션을 교차 검증해 문서 건강 상태를 계산한다. @sideEffect 출력 디렉터리와 데이터베이스를 읽는다.

func (*Generator) Run

func (g *Generator) Run() error

Run generates index.md and per-file docs into g.OutDir. @intent 전체 문서 산출물을 한 번에 다시 생성한다. @sideEffect 파일별 Markdown과 index.md를 출력 디렉터리에 기록한다.

type History

type History struct {
	Timestamp time.Time      `json:"timestamp"`
	Entries   map[string]int `json:"entries"` // "category:qualified_name" → consecutive count
}

History tracks lint results across runs for the Twice Rule. @intent 반복적으로 발생하는 문서 이슈를 누적 추적해 자동 규칙 승격에 활용한다.

func LoadHistory

func LoadHistory(path string) (*History, error)

LoadHistory reads the history file. Returns empty history if file doesn't exist. @intent 이전 lint 실행 이력을 복원해 연속 발생 여부를 판단할 수 있게 한다. @return 파일이 없으면 비어 있는 History를 반환한다.

func (*History) Save

func (h *History) Save(path string) error

Save writes the history to the given path, creating parent dirs if needed. @intent 다음 lint 실행이 이전 상태를 참조할 수 있도록 이력을 영속화한다. @sideEffect 대상 경로의 부모 디렉터리를 만들고 JSON 파일을 기록한다.

func (*History) Update

func (h *History) Update(currentKeys []string) []string

Update compares current lint keys against stored history. Returns keys that reached count >= 2 (Twice Rule triggered). Mutates h.Entries in place. @intent 현재 이슈 집합으로 연속 발생 카운트를 갱신한다. @domainRule 같은 키가 두 번 이상 연속 관측되면 Twice Rule 대상으로 간주한다. @mutates h.Entries, h.Timestamp

type LintReport

type LintReport struct {
	Orphans        []string        // doc files with no matching source in the graph
	Missing        []string        // source files in the graph with no doc file
	Stale          []string        // doc files older than the source's last update
	Unannotated    []string        // qualified names of symbols with no annotation
	Contradictions []Contradiction // annotated symbols whose code changed after the annotation
	DeadRefs       []DeadRef       // @see targets that do not exist in the graph
	Incomplete     []string        // annotated symbols with no @intent tag
	Drifted        []string        // annotated symbols whose node was updated after the annotation
}

LintReport contains the results of a documentation lint check. @intent 문서 생성물과 어노테이션 품질 점검 결과를 카테고리별로 반환한다.

Jump to

Keyboard shortcuts

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