2026-06-11 20:40:39 +02:00
<p align="center">
<img src="assets/glint-logo.png" alt="glint logo" width="220" />
</p>
2026-06-05 01:29:07 +02:00
2026-06-11 20:40:39 +02:00
<h1 align="center">glint</h1>
<p align="center">
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License"></a>
2026-06-25 00:25:09 +02:00
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/release-v0.2.23-blue.svg" alt="Release"></a>
2026-06-11 20:40:39 +02:00
</p>
2026-06-07 20:13:03 +02:00
> **Disclaimer:** This tool was built through iterative AI-assisted development with [Claude](https://claude.ai). It is experimental, incomplete, and not intended for production use. Coverage of GitLab CI keywords is best-effort and may lag behind GitLab's evolving spec. Use it at your own discretion — no correctness guarantees are made. Contributions and bug reports are welcome.
2026-06-05 01:29:07 +02:00
A local tool to validate and lint `.gitlab-ci.yml` pipelines without needing a GitLab server.
2026-06-14 11:07:51 +02:00
## What it does
- **Lints** — 43 rules covering pipeline structure, keyword constraints, `needs:` /`dependencies:` graphs, expression reachability, and deprecations (GL001– GL043); run `glint explain <ID>` for any rule
- **Resolves includes** — local files, HTTPS URLs, GitLab project templates, and CI/CD Catalog components, with offline cache support
2026-06-25 00:12:38 +02:00
- **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
2026-06-14 11:07:51 +02:00
- **Multiple output formats** — `--format text` (default, ruff-style), `json` , `sarif` (GitHub Code Scanning / GitLab SAST), `junit` , `github` (PR annotations)
- **Project config** — `.glint.yml` for rule suppression, severity overrides, token/URL defaults; `# glint: ignore RULE` for per-job inline suppression
- **Graph visualization** — `glint graph` prints a terminal job tree; `glint graph pipeline` renders a GitLab CI-style SVG/PNG
See [FEATURES.md ](FEATURES.md ) for the complete feature reference and lint rules table, and [ROADMAP.md ](ROADMAP.md ) for planned improvements.
2026-06-05 01:29:07 +02:00
## Requirements
- Go 1.21 or later
- [Task ](https://taskfile.dev ) (optional, for development tasks)
## Installation
```bash
2026-06-10 22:40:42 +02:00
git clone https://git.k3nny.fr/glint
cd glint
go build -o glint ./cmd/glint/...
2026-06-05 01:29:07 +02:00
```
Or with Task:
```bash
task build
```
## Usage
2026-06-11 00:27:28 +02:00
```
glint [OPTIONS] <COMMAND>
Commands:
check Lint a pipeline file — exits 0 (clean) or 1 (errors found)
graph Visualise the pipeline as a job tree or Mermaid graph
2026-06-14 11:07:51 +02:00
explain Print description and fix for a lint rule
2026-06-11 00:27:28 +02:00
```
2026-06-14 11:13:02 +02:00
Run `glint <command> --help` for all flags. See [USAGE.md ](USAGE.md ) for full
examples covering output formats, context simulation, remote includes, cache,
graph modes, and project configuration.
2026-06-05 01:29:07 +02:00
## Development
This project uses [Task ](https://taskfile.dev ) as a task runner.
```bash
task # list available tasks
task build # compile the binary
task test # run Go unit tests
task lint-go # run go vet
task validate # run the binary against all testdata fixtures
task ci # full check: vet → test → build → validate
2026-06-10 22:40:42 +02:00
task build-windows # cross-compile for Windows x64 (requires a tagged commit → glint-<tag>.exe)
task build-linux # cross-compile for Linux x64 (requires a tagged commit → glint-<tag>-linux-amd64)
2026-06-05 01:29:07 +02:00
task clean # remove build artifacts
```
## Project structure
```
.
2026-06-10 22:40:42 +02:00
├── cmd/glint/ # CLI entrypoint
2026-06-05 01:29:07 +02:00
├── internal/
2026-06-07 23:13:52 +02:00
│ ├── cicontext/ # CI variable context, rules:if: evaluator, job reachability
2026-06-07 20:13:03 +02:00
│ ├── fetcher/ # GitLab API client (project include fetching)
│ ├── graph/ # Mermaid and SVG/PNG graph generators
2026-06-05 01:29:07 +02:00
│ ├── linter/ # lint rules and findings
│ ├── model/ # pipeline data structures and YAML parser
2026-06-07 20:13:03 +02:00
│ └── resolver/ # extends: resolution and project include merging
2026-06-05 01:29:07 +02:00
├── testdata/ # sample pipelines used for manual validation
├── Taskfile.yml
└── go.mod
```