verify

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package verify は文書群の検証エンジン。 対象文書の解析、ルールの選択・実行、結果の集計を担う。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(res *Result, format string) (string, error)

Format は結果を text / json のいずれかで整形する。

func RuleNames

func RuleNames() []string

RuleNames は利用可能なルール名を返す。

Types

type Options

type Options struct {
	Rules  []string // 実行するルール名。空なら設定で有効な全ルール
	Strict bool     // 警告をエラーへ格上げする
}

Options は検証の入力。いずれも空なら設定ファイルの値を使う。

type Result

type Result struct {
	Rules    []RuleResult  `json:"rules"`
	Errors   []rules.Issue `json:"errors"`
	Warnings []rules.Issue `json:"warnings"`
	Summary  Summary       `json:"summary"`
}

Result は検証結果全体。

func Run

func Run(cfg *config.Config, paths []string, opts Options) (*Result, error)

Run は指定文書を検証する。

paths は呼び出し側で解決済みであることを前提とする(既定解決や 非通常ファイルの除去は行わない)。CLI は internal/cli.ExpandTargets を経由する。

func (*Result) HasErrors

func (r *Result) HasErrors() bool

HasErrors はエラーの有無を返す。終了コードの判定に使う。

type RuleResult

type RuleResult struct {
	Name     string        `json:"rule"`
	Errors   int           `json:"errors"`
	Warnings int           `json:"warnings"`
	Issues   []rules.Issue `json:"issues,omitempty"`
}

RuleResult は 1 ルール分の結果。

type Summary

type Summary struct {
	TotalErrors   int `json:"total_errors"`
	TotalWarnings int `json:"total_warnings"`
	Files         int `json:"files"`
}

Summary は全体集計。

Jump to

Keyboard shortcuts

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