Skip to content

Commit 0730b4a

Browse files
authored
ci: update flint to rust based version (#1142)
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 805c557 commit 0730b4a

10 files changed

Lines changed: 75 additions & 102 deletions

File tree

.github/config/.rumdl.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[global]
2+
disable = ["line-length", "ul-style", "no-inline-html", "fenced-code-language"]
3+
4+
[no-duplicate-heading]
5+
siblings-only = true
6+
7+
[no-trailing-punctuation]
8+
punctuation = ".,;:"
9+
10+
[ol-prefix]
11+
style = "ordered"

.github/config/flint.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[checks.lychee]
2+
check_all_local = true

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,19 @@ jobs:
6868
env:
6969
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
7070

71-
# this is not a required check to avoid blocking pull requests if external links break
72-
link-check:
73-
uses: ./.github/workflows/reusable-link-check.yml
74-
75-
markdown-lint-check:
76-
uses: ./.github/workflows/reusable-markdown-lint.yml
71+
lint:
72+
uses: ./.github/workflows/reusable-lint-check.yml
7773

7874
required-status-check:
7975
needs:
8076
- build
8177
- test-declarative-configuration-run
82-
- markdown-lint-check
78+
- lint
8379
runs-on: ubuntu-latest
8480
if: always()
8581
steps:
8682
- if: >
8783
needs.build.result != 'success' ||
8884
needs.test-declarative-configuration-run.result != 'success' ||
89-
needs.markdown-lint-check.result != 'success'
90-
run: exit 1
85+
needs.lint.result != 'success'
86+
run: exit 1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Reusable - Link check
1+
name: Reusable - Lint check
22

33
on:
44
workflow_call:
@@ -7,7 +7,7 @@ permissions:
77
contents: read
88

99
jobs:
10-
link-check:
10+
lint-check:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -16,16 +16,18 @@ jobs:
1616

1717
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
1818

19-
- name: Link check for pull requests
19+
- name: Lint for pull requests
2020
if: github.event_name == 'pull_request'
2121
env:
2222
GITHUB_TOKEN: ${{ github.token }}
23-
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
23+
GITHUB_REPOSITORY: ${{ github.repository }}
24+
GITHUB_BASE_REF: ${{ github.base_ref }}
25+
GITHUB_HEAD_REF: ${{ github.head_ref }}
2426
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
25-
run: mise run lint:links
27+
run: mise run lint
2628

27-
- name: Link check for pushes and scheduled workflows
29+
- name: Lint for pushes and workflow dispatches
2830
if: github.event_name != 'pull_request'
2931
env:
3032
GITHUB_TOKEN: ${{ github.token }}
31-
run: mise run lint:links --full
33+
run: mise run lint

.github/workflows/reusable-markdown-lint.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.markdownlint.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ To build the project, run:
1717
./gradlew assemble
1818
```
1919

20-
## Markdown linting
20+
## Linting
2121

22-
This repository uses [markdownlint](https://github.com/DavidAnson/markdownlint) via `markdownlint-cli2` managed by [mise](https://github.com/jdx/mise).
22+
This repository uses [flint](https://github.com/grafana/flint) managed by [mise](https://github.com/jdx/mise) to run the configured lint checks, including Markdown and link validation.
2323

24-
To check all Markdown files:
24+
To run all lint checks:
2525

2626
```bash
27-
mise run lint:markdown
27+
mise run lint
2828
```
2929

3030
(note: Windows users may need to run `mise install` first)
3131

3232
To automatically fix fixable issues:
3333

3434
```bash
35-
mise run lint:markdown --fix
35+
mise run lint:fix
3636
```
3737

3838
## Style guide

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,73 +23,73 @@ To build the all of examples, run:
2323

2424
- [Using the SDK AutoConfiguration module](autoconfigure)
2525
- This module contains a fully functional example of using the autoconfigure
26-
SDK extension module to configure the SDK using only environment
27-
variables (or system properties).
26+
SDK extension module to configure the SDK using only environment
27+
variables (or system properties).
2828
- Note: the `opentelemetry-sdk-extension-autoconfigure` module is still
29-
experimental at this time.
29+
experimental at this time.
3030
- [Manual instrumentation of HTTP](http)
3131
- This module provides an example of writing manual instrumentation for
32-
HTTP, both client and server.
32+
HTTP, both client and server.
3333
- Note: More production-ready instrumentation for HTTP is provided as part
34-
of the [OpenTelemetry Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation)
35-
project.
34+
of the [OpenTelemetry Java Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation)
35+
project.
3636
- [Manual span creation and baggage propagation](manual-tracing)
3737
- This module provides an example of manually creating spans using the
38-
OpenTelemetry API with the ExtendedTracer.
38+
OpenTelemetry API with the ExtendedTracer.
3939
- Additionally, it demonstrates how to use the OpenTelemetry API to
40-
propagate baggage items.
40+
propagate baggage items.
4141
- [Configuring the Jaeger Exporter](jaeger)
4242
- This module contains a fully functional example of configuring the
43-
OpenTelemetry SDK to use a Jaeger exporter and send spans to it
44-
using the OpenTelemetry API.
43+
OpenTelemetry SDK to use a Jaeger exporter and send spans to it
44+
using the OpenTelemetry API.
4545
- Note: This example requires Docker to be installed.
4646
- [Using the OpenTelemetry Java Agent](javaagent)
4747
- This module demonstrates using the OpenTelemetry Java Agent with a simple
48-
Spring Boot application. Traces, metrics, and logs are exported to a
49-
collector via OTLP.
48+
Spring Boot application. Traces, metrics, and logs are exported to a
49+
collector via OTLP.
5050
- [Spring native image telemetry with OpenTelemetry Spring Starter](spring-native)
5151
- This module demonstrates using the OpenTelemetry Spring Boot starter with a
52-
GraalVM native image. Traces and metrics are exported to a collector via OTLP.
52+
GraalVM native image. Traces and metrics are exported to a collector via OTLP.
5353
- [Configuring Log Appenders](log-appender)
5454
- This module demonstrates how to configure the Log4j and Logback appenders to
55-
bridge logs into the OpenTelemetry Log SDK.
55+
bridge logs into the OpenTelemetry Log SDK.
5656
- [Configuring the Logging Exporters](logging)
5757
- This module contains a fully functional example of configuring the
58-
OpenTelemetry SDK to use a logging exporter.
58+
OpenTelemetry SDK to use a logging exporter.
5959
- [Exporting application logs using JSON logging in Kubernetes](logging-k8s-stdout-otlp-json)
6060
- This module demonstrates how to export application logs using JSON logging
61-
in Kubernetes.
61+
in Kubernetes.
6262
- [Using the OpenTelemetry metrics API](metrics)
6363
- This module contains examples of using the OpenTelemetry metrics APIs.
6464
- [Using OpenTelemetry Micrometer shim](micrometer-shim)
6565
- This module contains an example of a typical Micrometer setup (Spring Boot
66-
with Spring Boot Actuator) configured to bridge metrics to OpenTelemetry
67-
with the Micrometer shim.
66+
with Spring Boot Actuator) configured to bridge metrics to OpenTelemetry
67+
with the Micrometer shim.
6868
- Note: The Micrometer shim is still experimental at this time.
6969
- [Setting up OTLP exporters](otlp)
7070
- OTLP is the OpenTelemetry Protocol. This module demonstrates how to
71-
configure the OTLP exporters and send data to the OpenTelemetry Collector
72-
using them.
71+
configure the OTLP exporters and send data to the OpenTelemetry Collector
72+
using them.
7373
- Note: This example requires Docker to be installed.
7474
- [Setting up the Prometheus exporter](prometheus)
7575
- This module shows how to configure the OpenTelemetry SDK to expose an
76-
endpoint that can be scraped by Prometheus.
76+
endpoint that can be scraped by Prometheus.
7777
- Note: The Prometheus metric reader is still experimental at this time.
7878
- [Manually Configuring the SDK](sdk-usage)
7979
- This module shows some concrete examples of manually configuring the
80-
OpenTelemetry SDK for tracing.
80+
OpenTelemetry SDK for tracing.
8181
- [Telemetry Testing](telemetry-testing)
8282
- This module demonstrates how to test OpenTelemetry instrumentation with
83-
MockServer.
83+
MockServer.
8484
- [Setting up the Zipkin exporter](zipkin)
8585
- This module contains a fully functional example of configuring the
86-
OpenTelemetry SDK to use a Zipkin exporter and send spans to a
87-
Zipkin backend using the OpenTelemetry API.
86+
OpenTelemetry SDK to use a Zipkin exporter and send spans to a
87+
Zipkin backend using the OpenTelemetry API.
8888
- Note: This example requires Docker to be installed.
8989
- [Declarative Configuration with the OpenTelemetry Java Agent](javaagent-declarative-configuration)
9090
- This module demonstrates how to use declarative configuration with the
91-
OpenTelemetry Java Agent to configure tracing behavior, including
92-
excluding specific endpoints from tracing.
91+
OpenTelemetry Java Agent to configure tracing behavior, including
92+
excluding specific endpoints from tracing.
9393
- Note: This example requires Java 17 or higher.
9494
- [Declarative Configuration with the OpenTelemetry Spring Boot Starter](spring-declarative-configuration)
9595
- This module demonstrates how to use declarative configuration with the

mise.toml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
[tools]
2-
lychee = "0.24.2"
2+
"aqua:grafana/oats" = "0.7.0"
33
k3d = "5.8.3"
4-
"go:github.com/grafana/oats" = "0.7.0"
54
kubectl = "1.36.1"
6-
markdownlint-cli2 = "0.22.1"
75

8-
[settings]
9-
# Only install tools explicitly defined in the [tools] section above
10-
idiomatic_version_file_enable_tools = []
6+
# Linters
7+
"aqua:grafana/flint" = "0.22.4"
8+
lychee = "0.24.2"
9+
rumdl = "0.1.91"
10+
11+
[env]
12+
FLINT_CONFIG_DIR = ".github/config"
1113

12-
# Windows configuration for file-based tasks
13-
# Based on: https://github.com/jdx/mise/discussions/4461
14-
windows_executable_extensions = ["sh"]
15-
windows_default_file_shell_args = "bash"
16-
unix_default_file_shell_args = "bash"
17-
use_file_shell_for_executable_tasks = true
14+
[tasks.lint]
15+
description = "Run all lints"
16+
run = "flint run"
1817

19-
# Pick the tasks you need from flint (https://github.com/grafana/flint)
20-
[tasks."lint:links"]
21-
description = "Check for broken links in changed files + all local links"
22-
file = "https://raw.githubusercontent.com/grafana/flint/3917356cdfc553d13e3857a2608fde6774366b28/tasks/lint/links.sh" # v0.22.4
18+
[tasks."lint:fix"]
19+
description = "Auto-fix lint issues"
20+
run = "flint run --fix"

spring-declarative-configuration/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ If the behavior is not what you expect, here are a few things to check:
230230

231231
- **Health checks are still traced**
232232
- Verify the `rules` section under `otel.tracer_provider.sampler.rule_based_routing` in
233-
`application.yaml`
233+
`application.yaml`
234234
- Ensure the `pattern` matches your actual actuator paths (e.g., `/actuator.*`)
235235
- Confirm that `span_kind` is set to `SERVER` (or another correct span kind for your traffic)
236236

@@ -243,7 +243,7 @@ If the behavior is not what you expect, here are a few things to check:
243243
- Make sure you are modifying the correct `application.yaml` for the active Spring profile
244244
- Verify that all configuration keys are indented correctly under the `otel:` root
245245
- Double-check that any placeholders use `:` for defaults (e.g.,
246-
`${OTEL_EXPORTER_OTLP_ENDPOINT:http://localhost:4318}`)
246+
`${OTEL_EXPORTER_OTLP_ENDPOINT:http://localhost:4318}`)
247247

248248
If issues persist, compare your configuration to:
249249

0 commit comments

Comments
 (0)