pkgstd

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 5 Imported by: 0

README

yze-go-pkgstd

A yze analyzer (category structure) enforcing the per-package standards of the gomatic three-tier CLI layout. For a command package (internal/app/commands/<cmd>/) it checks:

  • the first declaration of the command file (the one defining Command()) is a const block — conventionally the command's metadata (name, usage, argUsage, description), though the exact identifiers are not enforced because valid commands legitimately vary (e.g. omitting argUsage when there are no positional arguments);
  • a Command() entry point exists;
  • the domain package is imported under the domain alias.

Cross-package correspondence (every command has a matching internal/domain/<cmd>, and vice versa) is enforced separately by the yze-layout analyzer.

  • Rule: yze/pkgstd
  • Library: exports Analyzer and Registration for the yze aggregator and stickler runner.
  • Binary: cmd/yze-go-pkgstd runs it standalone (text/-json, and as a go vet -vettool).

Built on the go-yze framework.

Documentation

Overview

Package pkgstd provides a go/analysis analyzer enforcing the gomatic three-tier layout's per-package standards. For a command package (internal/app/commands/<cmd>): the command file (the first one defining a command entry point) leads with a const block, at least one entry point — Command() or an exported <Verb>Command() constructor for a package exposing several verbs (e.g. PlanCommand/ApplyCommand) — exists, and the domain package is imported under the "domain" alias. (Cross-package correspondence is the layout analyzer's job.)

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "pkgstd",
	Doc:  "reports command packages that violate the gomatic three-tier package standards",
	Run:  run,
}

Analyzer reports per-package violations of the three-tier command-package layout.

View Source
var Registration = goyze.Registration{
	Name:       "pkgstd",
	Categories: []goyze.Category{"structure"},
	URL:        "https://docs.gomatic.dev/yze/pkgstd",
	Analyzer:   Analyzer,
}

Registration declares this analyzer to the yze framework.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
yze-go-pkgstd command
Command yze-go-pkgstd runs the pkgstd analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).
Command yze-go-pkgstd runs the pkgstd analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).

Jump to

Keyboard shortcuts

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