-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x](backport #5443) mage: check that links are live in the OTel REA…
…DME (#5667) * mage: check that links are live in the OTel README (#5443) * mage: add check that links are live in the OTel README This PR adds a utility based on the `link-patrol` command to check if links in a given file are live. Added a check in the `check` and `otel:readme` targets to validate all links in the Otel Readme are valid. * remove unused directive for forbidigo * update doc for LinkCheck * update NOTICE.txt * Update license header with Elastic License 2.0 --------- Co-authored-by: Shaunak Kashyap <[email protected]> (cherry picked from commit 835cd9c) # Conflicts: # go.mod # go.sum * fix conflicts * mage notice * go mod tidy * go get github.com/rednafi/link-patrol/cmd/link-patrol --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
- Loading branch information
1 parent
a136144
commit 43341b8
Showing
8 changed files
with
332 additions
and
135 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License 2.0; | ||
// you may not use this file except in compliance with the Elastic License 2.0. | ||
|
||
package gotool | ||
|
||
import ( | ||
"github.com/magefile/mage/sh" | ||
) | ||
|
||
type goLinkCheck func(opts ...ArgOpt) error | ||
|
||
// LinkCheck runs a tool to verify that links in a file are live. | ||
var LinkCheck goLinkCheck = runGoLinkCheck | ||
|
||
func runGoLinkCheck(opts ...ArgOpt) error { | ||
args := buildArgs(opts).build() | ||
return sh.RunV("link-patrol", args...) | ||
} | ||
|
||
func (goLinkCheck) Path(path string) ArgOpt { return flagArgIf("-f", path) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.