Skip to content

Commit 3eb80e8

Browse files
gukoffKonstantin GukovTessFerrandez
authored
Change markdown link checker to lychee (#1078)
* Scaffold lychee instead of markdown-link-check * fix bad links * Remove another linkcheck solution * Switch documentation from markdownlinkcheck to lychee * Fix 2 more links * Ignore another link * Remove megalinter args for MARKDOWN_MARKDOWN_LINK_CHECK * Add "lycheeverse" do .cspell --------- Co-authored-by: Konstantin Gukov <[email protected]> Co-authored-by: Tess Ferrandez <[email protected]>
1 parent 47f00bb commit 3eb80e8

File tree

16 files changed

+147
-120
lines changed

16 files changed

+147
-120
lines changed

.cspell.json

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
"logissue",
245245
"longrunning",
246246
"Loukides",
247+
"lycheeverse",
247248
"makedirs",
248249
"Margit",
249250
"markdig",

.github/workflows/mega-linter.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
# Git Checkout
3232
- name: Checkout Code
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
with:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
fetch-depth: 0
@@ -39,8 +39,8 @@ jobs:
3939
- name: MegaLinter
4040
id: ml
4141
# You can override MegaLinter flavor used to have faster performances
42-
# More info at https://oxsecurity.github.io/megalinter/flavors/
43-
uses: oxsecurity/megalinter@v7.1.0
42+
# More info at https://megalinter.io/latest/flavors/
43+
uses: oxsecurity/megalinter@v8.1.0
4444
env:
4545
# All available variables are described in documentation
4646
# https://megalinter.io/latest/config-file/

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
##
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

6+
# Lychee link checker
7+
.lycheecache
8+
69
# User-specific files
710
*.suo
811
*.user

.markdown-link-check.json

-17
This file was deleted.

.mega-linter.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ ENABLE_LINTERS:
1212
- SPELL_CSPELL
1313
- YAML_PRETTIER
1414
- YAML_YAMLLINT
15-
- MDLINKCHECK_LINKCHECK
15+
- SPELL_LYCHEE
1616

1717
SPELL_CSPELL_DISABLE_ERRORS: true
18-
MARKDOWN_MARKDOWN_LINK_CHECK_DISABLE_ERRORS: true
1918
SHOW_ELAPSED_TIME: true
2019
FILEIO_REPORTER: false
2120
PARALLEL: true
2221
GITHUB_STATUS_REPORTER: true
2322
LOG_LEVEL: WARNING
24-
MARKDOWN_MARKDOWN_LINK_CHECK_ARGUMENTS: "-q"
2523
MARKDOWN_MARKDOWN_TABLE_FORMATTER_ARGUMENTS: "-c"
2624
# DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass
27-
PLUGINS:
28-
- https://raw.githubusercontent.com/shiranr/linkcheck/v2.0.20.changed_files/mega-linter-plugin-linkcheck/linkcheck.megalinter-descriptor.yml

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ When this occurs, do the following
7878
1. Verify that the link is OK, if it redirects, change the path to be the final link.
7979
1. If the link is not ok, fix the link (even if it is not in your document) if you find a good equivalent link. If you can't find a good equivalent link, contact one of the [maintainers](#maintainers) for a solution.
8080
1. Re-run the job, or ask to have the job re-run (if you are a first time contributor). Sometimes the link checker fails due to temporary connectivity issues.
81-
1. If the link checker still fails, and you have confirmed that the link is ok, exclude the link from checking, in the `.markdownlinkcheck.json` file in the root of the repository.
81+
1. If the link checker still fails, and you have confirmed that the link is ok, exclude the link from checking in the [lychee.toml](./lychee.toml) file.
8282

8383
## Running Locally (*Remotely*)
8484

@@ -96,7 +96,7 @@ For any questions or concerns, please contact [Tess Ferrandez](https://github.co
9696

9797
## Legal Notices
9898

99-
Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode), see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the [LICENSE-CODE](LICENSE-CODE) file.
99+
Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode), see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/license/MIT), see the [LICENSE-CODE](LICENSE-CODE) file.
100100

101101
Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft
102102
names, logos, or trademarks. Microsoft's general trademark guidelines can be found at <https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks>.

docs/CI-CD/continuous-integration.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ Implementing schema validation is divided in two - the generation of the schemas
171171

172172
There are two options to generate a schema:
173173

174-
- [From code](https://json-schema.org/implementations.html#from-code) - we can leverage the existing models and objects in the code and generate a customized schema.
175-
- [From data](https://json-schema.org/implementations.html#from-data) - we can take yaml/json samples which reflect the configuration in general and use the various online tools to generate a schema.
174+
- [From code](https://json-schema.org/tools?query=#code-to-schema) - we can leverage the existing models and objects in the code and generate a customized schema.
175+
- [From data](https://json-schema.org/tools?query=#data-to-schema) - we can take yaml/json samples which reflect the configuration in general and use the various online tools to generate a schema.
176176

177177
### Validation
178178

179-
The schema has 30+ [validators](https://json-schema.org/implementations.html#validators) for different languages, including 10+ for JavaScript, so no need to code it yourself.
179+
The schema has 30+ [validators](https://json-schema.org/tools?query=#validator) for different languages, including 10+ for JavaScript, so no need to code it yourself.
180180

181181
## Integration Validation
182182

docs/CI-CD/recipes/ci-pipeline-for-better-documentation.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ This pipeline helps address that!
1313
The pipeline uses the following `npm` modules:
1414

1515
- [markdownlint](https://github.com/DavidAnson/markdownlint): add standardization using [rules](https://github.com/DavidAnson/markdownlint#rules--aliases)
16-
- [markdown-link-check](https://github.com/tcort/markdown-link-check): check the links in the documentation and report broken
17-
ones
16+
- [lychee](https://github.com/lycheeverse/lychee): check the links in the documentation and report broken ones
1817
- [write-good](https://github.com/btford/write-good): linter for English prose
1918

2019
We have been using this pipeline for more than one year in different engagements and always received great feedback from the

docs/UI-UX/recommended-technologies.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The purpose of this page is to review the commonly selected technology options w
44

55
> Keep in mind that like all software, there is no "right way" to build a user interface application. Leverage and trust your team's or your customer's experience and expertise for the best development experience.
66
7-
Additionally, while some of these technologies are presented as alternate options, many can be combined together. For example, you can use React in a basic HTML/CSS/JS workflow by inline-importing React along with Babel. See the [Add React to a Website](https://reactjs.org/docs/add-react-to-a-website.html) for more details. Similarly, any [Fast](https://www.fast.design/) web component can be [integrated into any existing React application](https://www.fast.design/docs/integrations/react). And of course, every JavaScript technology can also be used with TypeScript!
7+
Additionally, while some of these technologies are presented as alternate options, many can be combined together. For example, you can use React in a basic HTML/CSS/JS workflow by inline-importing React along with Babel. See the [Add React to a Website](https://reactjs.org/docs/add-react-to-a-website.html) for more details. Similarly, any [Fast](https://www.fast.design/) web component can be [integrated into any existing React application](https://fast.design/docs/integrations#react). And of course, every JavaScript technology can also be used with TypeScript!
88

99
## TypeScript
1010

docs/automated-testing/integration-testing/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ Integration testing demonstrates how one module of a system, or external system,
6767

6868
## Resources
6969

70-
<!-- markdown-link-check-disable -->
7170
- [Integration testing approaches](https://www.softwaretestinghelp.com/what-is-integration-testing/)
72-
<!-- markdown-link-check-enable -->
7371
- [Integration testing pros and cons](https://www.geeksforgeeks.org/software-engineering-integration-testing/)
7472
- [Integration tests mocks and stubs](https://circleci.com/blog/how-to-test-software-part-i-mocking-stubbing-and-contract-testing/)
7573
- [Software Testing: Principles and Practices](https://www.goodreads.com/book/show/21278464-software-testing)

docs/code-reviews/recipes/markdown.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,19 @@ jobs:
115115
116116
### Checking Links
117117
118-
To automate link check in your markdown files add `markdown-link-check` action to your validation pipeline:
118+
To automate link check in your markdown files add `lycheeverse/lychee-action` action to your validation pipeline:
119119

120120
```yaml
121121
markdown-link-check:
122122
runs-on: ubuntu-latest
123123
steps:
124-
- uses: actions/checkout@master
125-
- uses: gaurav-nelson/github-action-markdown-link-check@v1
124+
- uses: actions/checkout@v4
125+
- name: Link Checker
126+
id: lychee
127+
uses: lycheeverse/lychee-action@v2
126128
```
127129

128-
More information about `markdown-link-check` action options can be found at [`markdown-link-check` home page](https://github.com/gaurav-nelson/github-action-markdown-link-check)
130+
More information about this action options can be found at [`lychee-action` home page](https://github.com/lycheeverse/lychee-action).
129131

130132
## Code Review Checklist
131133

docs/documentation/tools/automation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ If you want to automate some checks on your Markdown documents, there are severa
44

55
- Code Analysis / Linting
66
- [markdownlint](../../code-reviews/recipes/markdown.md#markdownlint) to verify Markdown syntax and enforce rules that make the text more readable.
7-
- [markdown-link-check](https://github.com/tcort/markdown-link-check) to extract links from markdown texts and check whether each link is alive (200 OK) or dead.
7+
- [lychee](https://github.com/lycheeverse/lychee) to extract links from markdown texts and check whether each link is alive (200 OK) or dead.
88
- [write-good](../../code-reviews/recipes/markdown.md#write-good) to check English prose.
99
- [Docker image for node-markdown-spellcheck](https://github.com/tmaier/docker-markdown-spellcheck), a lightweight docker image to spellcheck markdown files.
1010
- [static code analysis](../../CI-CD/dev-sec-ops/secrets-management/static-code-analysis.md)
@@ -16,7 +16,7 @@ If you want to automate some checks on your Markdown documents, there are severa
1616
- Automation
1717
- [pre-commit](https://pre-commit.com/) to use Git hook scripts to identify simple issues before submitting our code or documentation for review.
1818
- Check [Build validation](../../code-reviews/recipes/markdown.md#build-validation) to automate linting for PRs.
19-
- Check [CI Pipeline for better documentation](../../CI-CD/recipes/ci-pipeline-for-better-documentation.md) for a sample pipeline with `markdownlint`, `markdown-link-check` and `write-good`.
19+
- Check [CI Pipeline for better documentation](../../CI-CD/recipes/ci-pipeline-for-better-documentation.md) for a sample pipeline with `markdownlint`, `lychee` and `write-good`.
2020

2121
Sample output:
2222

docs/observability/tools/Prometheus.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Prometheus' metrics format is supported by a wide array of tools and services in
2828
- [New Relic](https://docs.newrelic.com/docs/integrations/prometheus-integrations/get-started/send-prometheus-metric-data-new-relic/)
2929
- [Flagger](https://docs.flagger.app/tutorials/prometheus-operator)
3030
- [Grafana](https://grafana.com/docs/grafana/latest/getting-started/getting-started-prometheus/)
31-
- [GitLab](https://docs.gitlab.com/ee/user/project/integrations/prometheus.html)
31+
- [GitLab](https://docs.gitlab.com/ee/administration/monitoring/prometheus/)
3232
- [etc...](https://prometheus.io/docs/operating/integrations/)
3333

3434
There are numerous [exporters](https://prometheus.io/docs/instrumenting/exporters/) which are used in exporting existing metrics from third-party databases, hardware, CI/CD tools, messaging systems, APIs and other monitoring systems. In addition to client libraries and exporters, there is a significant number of [integration points](https://prometheus.io/docs/operating/integrations/) for service discovery, remote storage, alerts and management.

docs/source-control/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ For most engagements having a single hosted DevOps environment (i.e. Azure DevOp
4444
* [ISE Git details](git-guidance/README.md)details on how to use Git as part of a [ISE](../ISE.md) project.
4545
* [GitHub - Removing sensitive data from a repository](https://help.github.com/articles/removing-sensitive-data-from-a-repository/)
4646
* [How Git Works Pluralsight course](https://www.pluralsight.com/courses/how-git-works)
47-
* [Mastering Git Pluralsight course](https://www.pluralsight.com/courses/master-git)
47+
* [Mastering Git Pluralsight course](https://www.pluralsight.com/courses/mastering-git)

linkcheck.json

-77
This file was deleted.

0 commit comments

Comments
 (0)