Documentation
¶
Overview ¶
Package apicheck implements the `glutter-gen apicheck` subcommand, which reads the public packages and reports what breaks the API conventions of SPEC §12.
Flutter: no counterpart.
Index ¶
Constants ¶
const ( // RuleCtorShape says that an exported NewX takes its optional parameters in a trailing // variadic options value (SPEC §12.1). RuleCtorShape = "ctor-shape" // RuleCtorOrder says that child, children, sliver and slivers come last among the // positional parameters (SPEC §12.2). RuleCtorOrder = "ctor-order" // RuleCtorSize says that a constructor has at most six required parameters (SPEC §12.1). RuleCtorSize = "ctor-size" // RuleDocRef says that the doc comment of a constructor, a function or a type ends with // a "Flutter:", "Glutter-specific:" or "flutter_svg:" paragraph (the last one is the reference // of package svg, which ports the flutter_svg package, SPEC §26). RuleDocRef = "doc-ref" // RuleEnumZero says that the zero value of an enum is <Enum>Unspecified (SPEC §12.3). RuleEnumZero = "enum-zero" // RuleMutableVar says that no exported package variable exists, as it could be // reassigned (CLAUDE.md, "No global mutable state"). RuleMutableVar = "mutable-var" // RuleSDLName says that no identifier of the module, in a public package or an internal one, uses SDL's names: no SDL_ // prefix, no name that starts with SDL and no Sdl inside a name (SPEC §28.1, D32; the owner's rule of 2026-11-05). RuleSDLName = "sdl-name" )
The rules, as they are named in a report and in an allow file.
Variables ¶
var DefaultPackages = []string{
"foundation", "scheduler", "animation", "physics", "gestures", "painting", "rendering",
"semantics", "services", "widgets", "material", "cupertino", "ui", "desktop", "gluttertest", "svg", "gpu", "vecmath", "viewport3d", "gamepad",
}
DefaultPackages are the public packages of the module, as directories below its root.
Flutter: no counterpart.
Functions ¶
Types ¶
type Violation ¶
type Violation struct {
// Rule is one of the Rule constants.
Rule string
// Pkg is the directory of the package below the root, such as "widgets".
Pkg string
// Name is the identifier, such as "NewPadding".
Name string
// File and Line are where the identifier is declared.
File string
Line int
// Message says what is wrong.
Message string
}
Violation is one place where the API breaks a rule.
Flutter: no counterpart.
func CheckDir ¶
CheckDir reads the Go files of root/pkg (not the tests) and returns the violations, in the order of their files and lines.
Flutter: no counterpart.
func CheckNames ¶
CheckNames reads every Go file of the module below root, tests included, and reports the identifiers that use SDL's names (RuleSDLName). The code that is ported from SDL 3 says so in its comments and in its strings, which this does not look at: only the names of Go identifiers count.
Flutter: no counterpart.