packcheck

package
v0.1.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 9 Imported by: 0 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 packcheck validates the structure of an ichava icon pack checkout: its composer.json, its manifest, that a pack config names it, its sets, licences and categories, and that every file under the sets is an SVG that parses. The `validate` command and the web UI's Validate page share it.

Index

Constants

View Source
const (
	ManifestPath = "resources/assets/svg/config.json"
	FilesDir     = "resources/assets/svg/files"
	LicencesDir  = "resources/assets/svg/licenses"
)

Where a pack keeps things, relative to its root.

View Source
const ComposerType = "ichava-icon-set"

ComposerType is how a pack is recognised, and the only way (ichava's own rule): no folder or package name is matched.

Variables

This section is empty.

Functions

func Discover

func Discover(dirs []string) (packs, missing []string)

Discover lists the ichava packs directly under each directory, by composer type, and the directories that do not exist.

Types

type Finding

type Finding struct {
	Level Level  `json:"level"`
	Check string `json:"check"`
	Path  string `json:"path,omitempty"`
	Text  string `json:"text"`
}

Finding is one problem. Path is relative to the pack root, for an annotation's file= and for a person; it may be empty.

type Level

type Level string

Level is how bad a finding is.

const (
	Error Level = "error"
	Warn  Level = "warning"
)

The levels.

type Options

type Options struct {
	// PackConfigs maps a composer name to the pack config that names it, so
	// a pack no config syncs is reported.
	PackConfigs map[string]string
	// ParseSVGs parses every SVG. Slow on the large packs (bundled has over
	// 120,000), so the web page makes it a choice.
	ParseSVGs bool
	// MaxListed caps the files a finding of one kind names one by one; the
	// rest are counted. Zero means 50.
	MaxListed int
}

Options tunes a check.

type Report

type Report struct {
	Root     string    `json:"root"`
	Name     string    `json:"name,omitempty"`
	Config   string    `json:"pack_config,omitempty"`
	Sets     int       `json:"sets"`
	SVGs     int       `json:"svgs"`
	Findings []Finding `json:"findings"`
}

Report is one pack's result.

func Check

func Check(root string, o Options) Report

Check validates one pack checkout.

func (Report) Errors

func (r Report) Errors() int

Errors and Warnings count the findings by level.

func (Report) Warnings

func (r Report) Warnings() int

Jump to

Keyboard shortcuts

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