diff --git a/.github/config/.rumdl.toml b/.github/config/.rumdl.toml new file mode 100644 index 00000000000..066c5b40f02 --- /dev/null +++ b/.github/config/.rumdl.toml @@ -0,0 +1,5 @@ +[MD013] +enabled = true +line-length = 120 +code-blocks = false +tables = false diff --git a/.github/config/.yamllint.yml b/.github/config/.yamllint.yml new file mode 100644 index 00000000000..5a46209b134 --- /dev/null +++ b/.github/config/.yamllint.yml @@ -0,0 +1,6 @@ +extends: relaxed + +rules: + document-start: disable + line-length: disable + indentation: warning diff --git a/.github/config/flint.toml b/.github/config/flint.toml new file mode 100644 index 00000000000..d1d7d128746 --- /dev/null +++ b/.github/config/flint.toml @@ -0,0 +1,2 @@ +[checks.lychee] +check_all_local = true diff --git a/.github/renovate.json5 b/.github/renovate.json5 index f5d4cb55f25..b427a417810 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,6 +1,7 @@ { $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: [ + "github>grafana/flint#v0.20.4", 'config:best-practices', 'helpers:pinGitHubActionDigestsToSemver', ], diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000000..e00a67b4f02 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Setup mise + uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1 + with: + version: v2026.4.18 + sha256: 6ae2d5f0f23a2f2149bc5d9bf264fe0922a1da843f1903e453516c462b23cc1f + + - name: Lint + env: + GITHUB_TOKEN: ${{ github.token }} + GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: mise run lint diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml index 8ea87549c37..b69b364e2b2 100644 --- a/.github/workflows/reusable-link-check.yml +++ b/.github/workflows/reusable-link-check.yml @@ -22,10 +22,10 @@ jobs: GITHUB_TOKEN: ${{ github.token }} GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }} PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} - run: mise run lint:links + run: mise run lint - name: Link check for pushes and scheduled workflows if: github.event_name != 'pull_request' env: GITHUB_TOKEN: ${{ github.token }} - run: mise run lint:links --full + run: mise run lint --full diff --git a/biome.json b/biome.json new file mode 100644 index 00000000000..4e68cbc7f6a --- /dev/null +++ b/biome.json @@ -0,0 +1,6 @@ +{ + "formatter": { + "indentStyle": "space", + "indentWidth": 2 + } +} diff --git a/mise.toml b/mise.toml index 11486456774..45a0c4b9ec8 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,22 @@ [tools] + +# Linters +actionlint = "1.7.12" +biome = "2.4.12" +"cargo:xmloxide" = "0.4.2" +"cargo:yaml-lint" = "0.1.0" +editorconfig-checker = "3.6.1" +"github:google/google-java-format" = "1.35.0" +"github:grafana/flint" = "0.20.4" +"github:pinterest/ktlint" = "1.8.0" lychee = "0.23.0" +"pipx:codespell" = "2.4.2" +rumdl = "0.1.80" +shellcheck = "0.11.0" +shfmt = "3.13.1" + +[env] +FLINT_CONFIG_DIR = ".github/config" [settings] # Only install tools explicitly defined in the [tools] section above @@ -11,7 +28,11 @@ windows_executable_extensions = ["sh"] windows_default_file_shell_args = "bash" use_file_shell_for_executable_tasks = true -# Pick the tasks you need from flint (https://github.com/grafana/flint) -[tasks."lint:links"] -description = "Check for broken links in changed files + all local links" -file = "https://raw.githubusercontent.com/grafana/flint/9de186b090a2ce39486ae3b1d3e696bd2e200d6a/tasks/lint/links.sh" # v0.20.3 +[tasks.lint] +description = "Run lint checks" +raw_args = true +run = "flint run" + +[tasks."lint:fix"] +description = "Auto-fix lint issues" +run = "flint run --fix"