Skip to content

Commit 61cbcfd

Browse files
[chore] Use linkspector to check links (#2070)
* Use linkspector to check links * add license * Use linkspector to check links * Use linkspector to check links --------- Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
1 parent 77e1f91 commit 61cbcfd

File tree

7 files changed

+4899
-661
lines changed

7 files changed

+4899
-661
lines changed

.github/.mlc_config.json

-16
This file was deleted.

.github/workflows/checks.yml

+39-47
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Checks
44

55
on:
66
push:
7-
branches: [ main ]
7+
branches: [main]
88
pull_request:
9-
branches: [ main ]
9+
branches: [main]
1010
workflow_dispatch:
1111

1212
jobs:
@@ -19,67 +19,59 @@ jobs:
1919
markdownlint:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- name: check out code
23-
uses: actions/checkout@v4
24-
25-
- name: install dependencies
26-
run: npm install
27-
28-
- name: run markdownlint
29-
run: make markdownlint
22+
- name: check out code
23+
uses: actions/checkout@v4
24+
- name: install dependencies
25+
run: npm install
26+
- name: run markdownlint
27+
run: make markdownlint
3028

3129
yamllint:
3230
runs-on: ubuntu-latest
3331
steps:
34-
- name: check out code
35-
uses: actions/checkout@v4
36-
37-
- uses: actions/setup-python@v5
38-
with:
39-
python-version: '3.x'
40-
41-
- name: install yamllint
42-
run: make install-yamllint
43-
44-
- name: run yamllint
45-
run: yamllint . -f github
32+
- name: check out code
33+
uses: actions/checkout@v4
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.x'
37+
- name: install yamllint
38+
run: make install-yamllint
39+
- name: run yamllint
40+
run: yamllint . -f github
4641

4742
misspell:
4843
runs-on: ubuntu-latest
4944
steps:
50-
- name: check out code
51-
uses: actions/checkout@v4
52-
53-
- name: run misspell
54-
run: make misspell
45+
- name: check out code
46+
uses: actions/checkout@v4
47+
- name: run misspell
48+
run: make misspell
5549

56-
markdownlinkcheck:
57-
name: markdownlinkcheck
50+
checklinks:
51+
name: linkspector
5852
runs-on: ubuntu-latest
5953
steps:
60-
- uses: actions/checkout@v4
61-
- name: Run link check
62-
uses: gaurav-nelson/github-action-markdown-link-check@v1
63-
with:
64-
use-quiet-mode: 'no'
65-
use-verbose-mode: 'yes'
66-
config-file: '.github/.mlc_config.json'
54+
- uses: actions/checkout@v4
55+
- name: Run linkspector
56+
uses: umbrelladocs/action-linkspector@v1
57+
with:
58+
level: info
59+
fail_level: any
60+
config_file: '.linkspector.yml'
6761

6862
sanity:
6963
runs-on: ubuntu-latest
70-
7164
steps:
72-
- uses: actions/checkout@v4
73-
74-
- name: run sanitycheck.py
75-
run: python3 ./internal/tools/sanitycheck.py
65+
- uses: actions/checkout@v4
66+
- name: run sanitycheck.py
67+
run: python3 ./internal/tools/sanitycheck.py
7668

7769
checklicense:
7870
runs-on: ubuntu-latest
7971
steps:
80-
- name: check out code
81-
uses: actions/checkout@v4
82-
- name: install tools
83-
run: make install-tools
84-
- name: run checklicense
85-
run: make checklicense
72+
- name: check out code
73+
uses: actions/checkout@v4
74+
- name: install tools
75+
run: make install-tools
76+
- name: run checklicense
77+
run: make checklicense

.linkspector.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
dirs:
5+
- .
6+
7+
excludedFiles:
8+
- ./CHANGELOG.md
9+
10+
ignorePatterns:
11+
- pattern: "^http://localhost:8080"
12+
- pattern: "^https://calendar.google.com/calendar"
13+
14+
aliveStatusCodes:
15+
- 200
16+
- 429
17+
18+
useGitIgnore: true
19+
20+
modifiedFilesOnly: false

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ the release.
77

88
## Unreleased
99

10+
* [chore] Use Linkspector to check links
11+
([#2070](https://github.com/open-telemetry/opentelemetry-demo/pull/2070))
1012
* [frontend] Cypress tests base image updated to 14.0.3
1113
([#2072](https://github.com/open-telemetry/opentelemetry-demo/pull/2072))
1214

Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,24 @@ yamllint: install-yamllint
6262
.PHONY: checklicense
6363
checklicense:
6464
@echo "Checking license headers..."
65+
@if ! npm ls @kt3k/license-checker; then npm install; fi
6566
npx @kt3k/license-checker -q
6667

6768
.PHONY: addlicense
6869
addlicense:
6970
@echo "Adding license headers..."
71+
@if ! npm ls @kt3k/license-checker; then npm install; fi
7072
npx @kt3k/license-checker -q -i
7173

74+
.PHONY: checklinks
75+
checklinks:
76+
@echo "Checking links..."
77+
@if ! npm ls @umbrelladocs/linkspector; then npm install; fi
78+
linkspector check
79+
7280
# Run all checks in order of speed / likely failure.
7381
.PHONY: check
74-
check: misspell markdownlint checklicense
82+
check: misspell markdownlint checklicense checklinks
7583
@echo "All checks complete"
7684

7785
# Attempt to fix issues / regenerate tables.

0 commit comments

Comments
 (0)