Documentation
¶
Overview ¶
Package cliflags provides a go/analysis analyzer enforcing the flag shape of the opinionated CLI standard on every urfave/cli v3 flag literal. Each rule is one line of the go-cli standard:
- every flag binds an environment variable via Sources: cli.EnvVars(...)
- every flag whose zero value is not its sensible default (i.e. all but booleans and slices) carries an explicit default via Value
- flag names are kebab-case
- an app-specific environment variable is UPPERCASE_SNAKE_CASE (prefixed with the app name when -app is set), while a well-known external variable (PG*, AWS_*, DOCKER_*, ...) is used UNPREFIXED — no KILROY_PGHOST; libpq already owns PGHOST
- no flag is Required — a required flag is a positional argument in disguise
A flag literal is a single-package fact, which is what makes these rules analyzer-shaped; the surrounding package structure is yze/cliapp's and stickler/clilayout's business. The well-known namespace list is seeded from the standard's own examples and extended with -external.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = newAnalyzer()
Analyzer reports urfave/cli v3 flag literals that break the flag standard.
View Source
var Registration = goyze.Registration{ Name: "cliflags", Categories: []goyze.Category{"cli"}, URL: "https://docs.gomatic.dev/yze/cliflags", 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-cliflags
command
Command yze-go-cliflags runs the cliflags analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).
|
Command yze-go-cliflags runs the cliflags analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`). |
Click to show internal directories.
Click to hide internal directories.