Skip to content

Commit c87fc76

Browse files
authored
ci: update to rust version of flint (#455)
* ci: update to rust version of flint Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * ci: preserve full link-check mode on push Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * ci: allow raw args for lint task Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * docs: fix OpenTelemetry Java coding patterns link Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: update flint to 0.20.4 Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * fix: add flint-managed linter configs Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * fix: finish rust-native formatter cutover Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: keep flint config under config dir Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * ci: keep flint rollout scoped to lychee Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: update flint to v0.21.0 Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: clarify yamllint ownership Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: rely on flint renovate preset Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: clean otel mise and renovate config Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: keep first-round otel tools minimal Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: keep first-round otel config minimal Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: keep first-round otel rollout minimal Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: restore minimal mise settings Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: drop unrelated contributing doc drift Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: sync contributing guide with upstream main Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * docs: point style guide link to coding patterns Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * ci: pass current flint GitHub env vars Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: drop redundant mise setting Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * chore: rely on flint task defaults Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * ci: rename lint workflow Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> * fix: drop unrelated editorconfig changes Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent a471753 commit c87fc76

6 files changed

Lines changed: 32 additions & 35 deletions

File tree

.github/config/flint.toml

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

.github/renovate.json5

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
33
extends: [
4+
"github>grafana/flint#v0.21.0",
45
'config:best-practices',
56
'helpers:pinGitHubActionDigestsToSemver',
67
'customManagers:githubActionsVersions',
@@ -66,17 +67,6 @@
6667
},
6768
],
6869
customManagers: [
69-
{
70-
// keep SHA-pinned raw.githubusercontent.com URLs in mise.toml up to date
71-
customType: 'regex',
72-
datasourceTemplate: 'github-tags',
73-
managerFilePatterns: [
74-
'/^mise\\.toml$/',
75-
],
76-
matchStrings: [
77-
'https://raw\\.githubusercontent\\.com/(?<depName>[^/]+/[^/]+)/(?<currentDigest>[a-f0-9]{40})/.*#\\s*(?<currentValue>v\\S+)',
78-
],
79-
},
8070
{
8171
customType: 'regex',
8272
datasourceTemplate: 'docker',

.github/workflows/build-pull-request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
with:
1717
cache-read-only: true
1818

19-
link-check:
20-
uses: ./.github/workflows/reusable-link-check.yml
19+
lint:
20+
uses: ./.github/workflows/reusable-lint-check.yml
2121

2222
required-status-check:
2323
if: always()
2424
needs:
2525
- common
26-
- link-check # wait for link check to complete, but don't require it to pass for merging
26+
- lint # wait for lint to complete, but don't require it to pass for merging
2727
runs-on: ubuntu-latest
2828
steps:
2929
# The reusable workflow success depends on all its jobs passing
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 scheduled workflows
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 --full

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ generate semantic conventions classes from the release contents.
3636

3737
## Style guide
3838

39-
This repository follows the OpenTelemetry Java
40-
repository's [style guide](https://github.com/open-telemetry/opentelemetry-java/blob/main/CONTRIBUTING.md#style-guideline).
39+
This repository follows the OpenTelemetry Java repository's
40+
[coding patterns](https://github.com/open-telemetry/opentelemetry-java/blob/main/docs/knowledge/README.md).

mise.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[tools]
2+
3+
# Linters
4+
"github:grafana/flint" = "0.21.0"
25
lychee = "0.23.0"
36

4-
[settings]
5-
# Only install tools explicitly defined in the [tools] section above
6-
idiomatic_version_file_enable_tools = []
7+
[tasks.lint]
8+
description = "Run link checks"
9+
raw_args = true
10+
run = "flint run"
711

8-
# Windows configuration for file-based tasks
9-
# Based on: https://github.com/jdx/mise/discussions/4461
10-
windows_executable_extensions = ["sh"]
11-
windows_default_file_shell_args = "bash"
12-
use_file_shell_for_executable_tasks = true
12+
[tasks."lint:fix"]
13+
description = "Auto-fix lint issues"
14+
run = "flint run --fix"
1315

14-
# Pick the tasks you need from flint (https://github.com/grafana/flint)
15-
[tasks."lint:links"]
16-
description = "Check for broken links in changed files + all local links"
17-
file = "https://raw.githubusercontent.com/grafana/flint/feab606ce514fbbf2722cc26aeafa39956383cf3/tasks/lint/links.sh" # v0.21.0
16+
[env]
17+
FLINT_CONFIG_DIR = ".github/config"

0 commit comments

Comments
 (0)