Skip to content

Commit

Permalink
[chore] Use linkspector to check links (#2070)
Browse files Browse the repository at this point in the history
* Use linkspector to check links

* add license

* Use linkspector to check links

* Use linkspector to check links

---------

Co-authored-by: Juliano Costa <[email protected]>
  • Loading branch information
puckpuck and julianocosta89 authored Feb 25, 2025
1 parent 77e1f91 commit 61cbcfd
Show file tree
Hide file tree
Showing 7 changed files with 4,899 additions and 661 deletions.
16 changes: 0 additions & 16 deletions .github/.mlc_config.json

This file was deleted.

86 changes: 39 additions & 47 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Checks

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
workflow_dispatch:

jobs:
Expand All @@ -19,67 +19,59 @@ jobs:
markdownlint:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v4

- name: install dependencies
run: npm install

- name: run markdownlint
run: make markdownlint
- name: check out code
uses: actions/checkout@v4
- name: install dependencies
run: npm install
- name: run markdownlint
run: make markdownlint

yamllint:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: install yamllint
run: make install-yamllint

- name: run yamllint
run: yamllint . -f github
- name: check out code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: install yamllint
run: make install-yamllint
- name: run yamllint
run: yamllint . -f github

misspell:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v4

- name: run misspell
run: make misspell
- name: check out code
uses: actions/checkout@v4
- name: run misspell
run: make misspell

markdownlinkcheck:
name: markdownlinkcheck
checklinks:
name: linkspector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run link check
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'no'
use-verbose-mode: 'yes'
config-file: '.github/.mlc_config.json'
- uses: actions/checkout@v4
- name: Run linkspector
uses: umbrelladocs/action-linkspector@v1
with:
level: info
fail_level: any
config_file: '.linkspector.yml'

sanity:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: run sanitycheck.py
run: python3 ./internal/tools/sanitycheck.py
- uses: actions/checkout@v4
- name: run sanitycheck.py
run: python3 ./internal/tools/sanitycheck.py

checklicense:
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@v4
- name: install tools
run: make install-tools
- name: run checklicense
run: make checklicense
- name: check out code
uses: actions/checkout@v4
- name: install tools
run: make install-tools
- name: run checklicense
run: make checklicense
20 changes: 20 additions & 0 deletions .linkspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

dirs:
- .

excludedFiles:
- ./CHANGELOG.md

ignorePatterns:
- pattern: "^http://localhost:8080"
- pattern: "^https://calendar.google.com/calendar"

aliveStatusCodes:
- 200
- 429

useGitIgnore: true

modifiedFilesOnly: false
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ the release.

## Unreleased

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

Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,24 @@ yamllint: install-yamllint
.PHONY: checklicense
checklicense:
@echo "Checking license headers..."
@if ! npm ls @kt3k/license-checker; then npm install; fi
npx @kt3k/license-checker -q

.PHONY: addlicense
addlicense:
@echo "Adding license headers..."
@if ! npm ls @kt3k/license-checker; then npm install; fi
npx @kt3k/license-checker -q -i

.PHONY: checklinks
checklinks:
@echo "Checking links..."
@if ! npm ls @umbrelladocs/linkspector; then npm install; fi
linkspector check

# Run all checks in order of speed / likely failure.
.PHONY: check
check: misspell markdownlint checklicense
check: misspell markdownlint checklicense checklinks
@echo "All checks complete"

# Attempt to fix issues / regenerate tables.
Expand Down
Loading

0 comments on commit 61cbcfd

Please sign in to comment.