Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*.md]
max_line_length = 120
Comment thread
zeitlinger marked this conversation as resolved.
9 changes: 9 additions & 0 deletions .github/config/flint.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
exclude = [
"CHANGELOG.md",
"yaml/testdata/**",
"yaml/docker-compose-docker-lgtm-template.yml",
]

[checks.renovate-deps]
exclude_managers = ["github-actions", "github-runners"]
32 changes: 0 additions & 32 deletions .github/config/super-linter.env

This file was deleted.

16 changes: 11 additions & 5 deletions .github/renovate-tracked-deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,21 @@
},
"mise.toml": {
"mise": [
"actionlint",
"editorconfig-checker",
"github:grafana/flint",
"go",
"golangci-lint",
"hadolint",
"lychee",
"node",
"npm:renovate"
],
"regex": [
"ghcr.io/super-linter/super-linter",
"grafana/flint"
"npm:@biomejs/biome",
"npm:markdownlint-cli2",
"npm:prettier",
"npm:renovate",
"pipx:codespell",
"shellcheck",
"shfmt"
]
},
"yaml/testdata/docker-compose-addition.yaml": {
Expand Down
2 changes: 1 addition & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
extends: [
"config:best-practices",
"config:recommended",
"github>grafana/flint",
"github>grafana/flint#v0.20.3",
],
automerge: true,
}
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: Build, Lint, and Test
name: Build and Test

on: [pull_request]

permissions: {}

jobs:
test:
build:
Comment thread
zeitlinger marked this conversation as resolved.
runs-on: ubuntu-24.04
steps:
- name: Check out
Expand All @@ -17,5 +17,7 @@ jobs:
with:
version: v2026.4.15
sha256: c55befc52e5694f388b927ef304362ca7b9e919d97d43c342fca57f2eccea255
- name: Build
run: mise run build
- name: Run tests
run: mise run check
run: mise run test
2 changes: 2 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Line length is enforced by editorconfig-checker via .editorconfig
MD013: false
Comment thread
zeitlinger marked this conversation as resolved.
23 changes: 10 additions & 13 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,25 @@ mise run integration-test

# Run end-to-end tests
mise run e2e-test

# Run all checks (lint + test + format check)
mise run check
```

## Linting

```bash
# Auto-fix and verify (recommended dev workflow)
mise run fix
# Auto-fix lint issues (recommended dev workflow)
mise run lint:fix

# Verify only (same command used in CI)
mise run lint

# Go linting only
mise run lint:go

# Format Go code
mise run fmt
# Run all checks
mise run check
```
Comment thread
zeitlinger marked this conversation as resolved.

Lint tasks are sourced from [grafana/flint](https://github.com/grafana/flint).
Linting is handled by [flint v2](https://github.com/grafana/flint).
Flint runs shellcheck, shfmt, actionlint, hadolint, markdownlint, prettier,
codespell, editorconfig, lychee, renovate-deps, and gofmt. EditorConfig rules
live in `.editorconfig`.

## Architecture

Expand Down Expand Up @@ -103,6 +100,6 @@ Key flags: `-timeout` (default 30s), `-lgtm-version` (default "latest"), `-manua

## CI

- Build + lint + test on PRs (`mise run check`)
- Lint on PRs (`mise run lint`), build on PRs (`mise run build`), tests on PRs (`mise run test`)
- Integration tests and e2e tests in separate workflows
- Linting via flint (super-linter, lychee, golangci-lint)
- Linting via flint v2
7 changes: 7 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// Keep JSON formatting aligned with the repo's two-space style.
"formatter": {
"indentStyle": "space",
"indentWidth": 2
}
}
84 changes: 26 additions & 58 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,44 +1,32 @@
[tools]
go = "1.26.2"
node = "24.15.0"

# Linters
actionlint = "1.7.10"
editorconfig-checker = "v3.6.0"
"github:grafana/flint" = "0.20.3"
golangci-lint = "2.11.4"
hadolint = "v2.14.0"
lychee = "0.22.0"
node = "24.15.0"
"npm:@biomejs/biome" = "2.4.12"
"npm:markdownlint-cli2" = "0.17.2"
"npm:prettier" = "3.8.1"
"npm:renovate" = "43.127.1"
"pipx:codespell" = "2.4.1"
shellcheck = "v0.11.0"
shfmt = "v3.12.0"

[env]
RENOVATE_TRACKED_DEPS_EXCLUDE="github-actions,github-runners"
# renovate: datasource=docker depName=ghcr.io/super-linter/super-linter
SUPER_LINTER_VERSION="v8.4.0@sha256:c5e3307932203ff9e1e8acfe7e92e894add6266605b5d7fb525fb371a59a26f4"
FLINT_CONFIG_DIR = ".github/config"

# Shared lint tasks from flint (https://github.com/grafana/flint)
[tasks."lint:super-linter"]
description = "Run Super-Linter on the repository"
file = "https://raw.githubusercontent.com/grafana/flint/5af56d473d2f82ec5af0fad36b054bde2bd2f8cf/tasks/lint/super-linter.sh" # v0.20.1
[tasks."lint:links"]
description = "Check for broken links in changed files + all local links"
file = "https://raw.githubusercontent.com/grafana/flint/5af56d473d2f82ec5af0fad36b054bde2bd2f8cf/tasks/lint/links.sh" # v0.20.1
[tasks."lint:renovate-deps"]
description = "Verify renovate-tracked-deps.json is up to date"
file = "https://raw.githubusercontent.com/grafana/flint/5af56d473d2f82ec5af0fad36b054bde2bd2f8cf/tasks/lint/renovate-deps.py" # v0.20.1

[tasks."setup:native-lint-tools"]
description = "Install native lint tools matching the pinned super-linter version"
file = "https://raw.githubusercontent.com/grafana/flint/5af56d473d2f82ec5af0fad36b054bde2bd2f8cf/tasks/setup/native-lint-tools.sh" # v0.20.1
[tasks."lint:fast"]
description = "Run fast lints (no Renovate)"
depends = ["lint:super-linter", "lint:links", "lint:go"]

[tasks.native-lint]
description = "Run lints natively (no container)"
run = "NATIVE=true mise run lint:fast"
[tasks.lint]
description = "Run all lints"
run = "flint run"

[tasks.pre-commit]
description = "Pre-commit hook: native lint"
depends = ["setup:native-lint-tools"]
run = "NATIVE=true mise run lint:fast"
[tasks."setup:pre-commit-hook"]
description = "Install git pre-commit hook that runs native linting"
run = "mise generate git-pre-commit --write --task=pre-commit"
[tasks."lint:fix"]
description = "Auto-fix lint issues"
run = "flint run --fix"

[tasks.test]
description = "Run tests"
Expand All @@ -49,34 +37,14 @@ description = "Run integration tests"
env.INTEGRATION_TESTS = "true"
run = "go test github.com/grafana/oats/tests"

[tasks.fmt]
description = "Format code"
run = "gofmt -w ."

[tasks.check-fmt]
description = "Check code formatting"
run = "gofmt -l . | grep . && exit 1 || exit 0"

[tasks."lint:go"]
description = "Lint Go code"
run = "golangci-lint run"

[tasks."lint"]
description = "Run all lints"
depends = ["lint:fast", "lint:renovate-deps"]
[tasks.build]
description = "Build the project"
run = "go build"
Comment thread
zeitlinger marked this conversation as resolved.

[tasks.fix]
description = "Auto-fix lint issues and regenerate tracked deps"
run = "AUTOFIX=true mise run lint"
[tasks.check]
description = "Run all checks"
depends = ["lint", "test"]

[tasks.deps]
description = "Update dependencies"
run = "go mod tidy"

[tasks.check]
description = "Run all checks"
depends = ['lint:go', 'test', 'check-fmt']

[tasks.build]
description = "Build the project"
run = "go build"
Loading