feat(cli): make tree the sole default for glint graph
ci / vet, staticcheck, test, build (push) Successful in 2m16s
ci / vet, staticcheck, test, build (push) Successful in 2m16s
Previously glint graph with no mode printed tree + separator + includes Mermaid. Now glint graph defaults to tree only; use glint graph includes for the Mermaid include-dependency output. Simplifies the common case and makes the default output immediately actionable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -317,10 +317,10 @@ jobs or pipeline-level findings.
|
|||||||
|
|
||||||
| Mode | Output |
|
| Mode | Output |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| `tree` (default) | Terminal job tree: stages as branches, jobs as leaves; annotated with `[manual]`, `[delayed]`, `[trigger]` where applicable |
|
| `tree` *(default)* | Terminal job tree: stages as branches, jobs as leaves; annotated with `[manual]`, `[delayed]`, `[trigger]` where applicable |
|
||||||
| `includes` | Mermaid flowchart to stdout; colour-coded nodes by include type (local, remote, project, component, template) |
|
| `includes` | Mermaid flowchart of include dependencies to stdout; colour-coded by include type (local, remote, project, component, template) |
|
||||||
| `pipeline` | GitLab CI-style SVG/PNG written to `--out` directory (default: `glint-out/`); converted to PNG when `rsvg-convert`, `inkscape`, or `magick` is available |
|
| `pipeline` | GitLab CI-style SVG/PNG written to `--out` directory (default: `glint-out/`); converted to PNG when `rsvg-convert`, `inkscape`, or `magick` is available |
|
||||||
| `all` | `includes` to stdout + `pipeline` file path to stderr |
|
| `all` | `includes` Mermaid to stdout + `pipeline` SVG/PNG path to stderr |
|
||||||
|
|
||||||
**`glint graph pipeline --format <FORMAT>`**
|
**`glint graph pipeline --format <FORMAT>`**
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ A local tool to validate and lint `.gitlab-ci.yml` pipelines without needing a G
|
|||||||
- **Simulates context** — `--branch`, `--tag`, `--source` flags evaluate `rules:if:` and `only`/`except` to show which jobs would be active, manual, or skipped; `--context branch=main --context branch=develop` prints a multi-column comparison table across multiple contexts in one run
|
- **Simulates context** — `--branch`, `--tag`, `--source` flags evaluate `rules:if:` and `only`/`except` to show which jobs would be active, manual, or skipped; `--context branch=main --context branch=develop` prints a multi-column comparison table across multiple contexts in one run
|
||||||
- **Multiple output formats** — `--format text` (default, colorized and column-aligned), `json`, `sarif` (GitHub Code Scanning / GitLab SAST), `junit`, `github` (PR annotations); exits `2` on errors, `10` on warnings only
|
- **Multiple output formats** — `--format text` (default, colorized and column-aligned), `json`, `sarif` (GitHub Code Scanning / GitLab SAST), `junit`, `github` (PR annotations); exits `2` on errors, `10` on warnings only
|
||||||
- **Project config** — `.glint.yml` for rule suppression, severity overrides, token/URL/proxy defaults; `# glint: ignore RULE` for per-job inline suppression; `--no-warn` flag to suppress all warnings
|
- **Project config** — `.glint.yml` for rule suppression, severity overrides, token/URL/proxy defaults; `# glint: ignore RULE` for per-job inline suppression; `--no-warn` flag to suppress all warnings
|
||||||
- **Graph visualization** — `glint graph` prints a terminal job tree; `glint graph pipeline` renders a GitLab CI-style SVG/PNG; `--format mermaid` emits a Mermaid flowchart; `--format html` produces a self-contained HTML file with pan/zoom and a job-detail sidebar; `--no-skipped` hides jobs that would not run in the given context
|
- **Graph visualization** — `glint graph` prints a terminal job tree (default); `glint graph includes` emits a Mermaid include-dependency graph; `glint graph pipeline` renders a GitLab CI-style SVG/PNG; `--format mermaid` or `--format html` for alternative pipeline output; `--no-skipped` hides jobs that would not run in the given context
|
||||||
- **LSP server** — `glint lsp` starts a Language Server Protocol server over stdin/stdout; connect with any LSP client to get inline diagnostics (rule ID as code, error/warning severity) in VS Code, Neovim, Emacs, JetBrains, etc.
|
- **LSP server** — `glint lsp` starts a Language Server Protocol server over stdin/stdout; connect with any LSP client to get inline diagnostics (rule ID as code, error/warning severity) in VS Code, Neovim, Emacs, JetBrains, etc.
|
||||||
- **VS Code extension** — `editors/vscode/` wraps the LSP server; inline squiggles for every glint rule directly in the editor
|
- **VS Code extension** — `editors/vscode/` wraps the LSP server; inline squiggles for every glint rule directly in the editor
|
||||||
|
|
||||||
|
|||||||
+4
-8
@@ -498,12 +498,12 @@ func cmdGraph(args []string) {
|
|||||||
format := fs.String("format", "svg", "pipeline output format: svg, mermaid, or html")
|
format := fs.String("format", "svg", "pipeline output format: svg, mermaid, or html")
|
||||||
fs.Usage = func() {
|
fs.Usage = func() {
|
||||||
fmt.Fprintf(os.Stderr, "glint %s\n\n", version)
|
fmt.Fprintf(os.Stderr, "glint %s\n\n", version)
|
||||||
fmt.Fprint(os.Stderr, `Visualise the pipeline as a job tree and/or Mermaid graph.
|
fmt.Fprint(os.Stderr, `Visualise the pipeline as a job tree or graph.
|
||||||
|
|
||||||
Usage: glint graph [MODE] [OPTIONS] <PIPELINE>
|
Usage: glint graph [MODE] [OPTIONS] <PIPELINE>
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
[MODE] Graph mode; must appear before options [default: tree+includes]
|
[MODE] Graph mode; must appear before options [default: tree]
|
||||||
[possible values: tree, includes, pipeline, all]
|
[possible values: tree, includes, pipeline, all]
|
||||||
<PIPELINE> Path to the .gitlab-ci.yml file
|
<PIPELINE> Path to the .gitlab-ci.yml file
|
||||||
|
|
||||||
@@ -592,11 +592,11 @@ always evaluated.
|
|||||||
Examples:
|
Examples:
|
||||||
glint graph .gitlab-ci.yml
|
glint graph .gitlab-ci.yml
|
||||||
glint graph tree .gitlab-ci.yml
|
glint graph tree .gitlab-ci.yml
|
||||||
|
glint graph includes .gitlab-ci.yml > includes.mmd
|
||||||
glint graph tree --branch develop .gitlab-ci.yml
|
glint graph tree --branch develop .gitlab-ci.yml
|
||||||
glint graph tree --tag v1.0.0 .gitlab-ci.yml
|
glint graph tree --tag v1.0.0 .gitlab-ci.yml
|
||||||
glint graph tree --list-vars .gitlab-ci.yml
|
glint graph tree --list-vars .gitlab-ci.yml
|
||||||
glint graph tree --changes src/main.go .gitlab-ci.yml
|
glint graph tree --changes src/main.go .gitlab-ci.yml
|
||||||
glint graph includes .gitlab-ci.yml > includes.mmd
|
|
||||||
glint graph pipeline .gitlab-ci.yml
|
glint graph pipeline .gitlab-ci.yml
|
||||||
glint graph pipeline --out /tmp/graphs .gitlab-ci.yml
|
glint graph pipeline --out /tmp/graphs .gitlab-ci.yml
|
||||||
glint graph pipeline --format mermaid .gitlab-ci.yml
|
glint graph pipeline --format mermaid .gitlab-ci.yml
|
||||||
@@ -709,11 +709,7 @@ Examples:
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch mode {
|
switch mode {
|
||||||
case "default":
|
case "default", "tree":
|
||||||
fmt.Print(graph.Tree(p, ctx))
|
|
||||||
fmt.Println("---")
|
|
||||||
fmt.Print(graph.Includes(path, p.Include, cfg))
|
|
||||||
case "tree":
|
|
||||||
fmt.Print(graph.Tree(p, ctx))
|
fmt.Print(graph.Tree(p, ctx))
|
||||||
case "includes":
|
case "includes":
|
||||||
fmt.Print(graph.Includes(path, p.Include, cfg))
|
fmt.Print(graph.Includes(path, p.Include, cfg))
|
||||||
|
|||||||
Reference in New Issue
Block a user