Skip to content

Change markdown link checker to lychee #1078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
"logissue",
"longrunning",
"Loukides",
"lycheeverse",
"makedirs",
"Margit",
"markdig",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
Expand All @@ -39,8 +39,8 @@ jobs:
- name: MegaLinter
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://oxsecurity.github.io/megalinter/flavors/
uses: oxsecurity/megalinter@v7.1.0
# More info at https://megalinter.io/latest/flavors/
uses: oxsecurity/megalinter@v8.1.0
env:
# All available variables are described in documentation
# https://megalinter.io/latest/config-file/
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# Lychee link checker
.lycheecache

# User-specific files
*.suo
*.user
Expand Down
17 changes: 0 additions & 17 deletions .markdown-link-check.json

This file was deleted.

6 changes: 1 addition & 5 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ ENABLE_LINTERS:
- SPELL_CSPELL
- YAML_PRETTIER
- YAML_YAMLLINT
- MDLINKCHECK_LINKCHECK
- SPELL_LYCHEE

SPELL_CSPELL_DISABLE_ERRORS: true
MARKDOWN_MARKDOWN_LINK_CHECK_DISABLE_ERRORS: true
SHOW_ELAPSED_TIME: true
FILEIO_REPORTER: false
PARALLEL: true
GITHUB_STATUS_REPORTER: true
LOG_LEVEL: WARNING
MARKDOWN_MARKDOWN_LINK_CHECK_ARGUMENTS: "-q"
MARKDOWN_MARKDOWN_TABLE_FORMATTER_ARGUMENTS: "-c"
# DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass
PLUGINS:
- https://raw.githubusercontent.com/shiranr/linkcheck/v2.0.20.changed_files/mega-linter-plugin-linkcheck/linkcheck.megalinter-descriptor.yml
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ When this occurs, do the following
1. Verify that the link is OK, if it redirects, change the path to be the final link.
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.
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.
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.
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.

## Running Locally (*Remotely*)

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

## Legal Notices

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.
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.

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
names, logos, or trademarks. Microsoft's general trademark guidelines can be found at <https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks>.
Expand Down
6 changes: 3 additions & 3 deletions docs/CI-CD/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ Implementing schema validation is divided in two - the generation of the schemas

There are two options to generate a schema:

- [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.
- [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.
- [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.
- [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.

### Validation

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.
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.

## Integration Validation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ This pipeline helps address that!
The pipeline uses the following `npm` modules:

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

We have been using this pipeline for more than one year in different engagements and always received great feedback from the
Expand Down
2 changes: 1 addition & 1 deletion docs/UI-UX/recommended-technologies.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The purpose of this page is to review the commonly selected technology options w

> 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.

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!
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!

## TypeScript

Expand Down
2 changes: 0 additions & 2 deletions docs/automated-testing/integration-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ Integration testing demonstrates how one module of a system, or external system,

## Resources

<!-- markdown-link-check-disable -->
- [Integration testing approaches](https://www.softwaretestinghelp.com/what-is-integration-testing/)
<!-- markdown-link-check-enable -->
- [Integration testing pros and cons](https://www.geeksforgeeks.org/software-engineering-integration-testing/)
- [Integration tests mocks and stubs](https://circleci.com/blog/how-to-test-software-part-i-mocking-stubbing-and-contract-testing/)
- [Software Testing: Principles and Practices](https://www.goodreads.com/book/show/21278464-software-testing)
Expand Down
10 changes: 6 additions & 4 deletions docs/code-reviews/recipes/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,19 @@ jobs:

### Checking Links

To automate link check in your markdown files add `markdown-link-check` action to your validation pipeline:
To automate link check in your markdown files add `lycheeverse/lychee-action` action to your validation pipeline:

```yaml
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
- uses: actions/checkout@v4
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
```

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)
More information about this action options can be found at [`lychee-action` home page](https://github.com/lycheeverse/lychee-action).

## Code Review Checklist

Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/tools/automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ If you want to automate some checks on your Markdown documents, there are severa

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

Sample output:

Expand Down
2 changes: 1 addition & 1 deletion docs/observability/tools/Prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Prometheus' metrics format is supported by a wide array of tools and services in
- [New Relic](https://docs.newrelic.com/docs/integrations/prometheus-integrations/get-started/send-prometheus-metric-data-new-relic/)
- [Flagger](https://docs.flagger.app/tutorials/prometheus-operator)
- [Grafana](https://grafana.com/docs/grafana/latest/getting-started/getting-started-prometheus/)
- [GitLab](https://docs.gitlab.com/ee/user/project/integrations/prometheus.html)
- [GitLab](https://docs.gitlab.com/ee/administration/monitoring/prometheus/)
- [etc...](https://prometheus.io/docs/operating/integrations/)

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.
Expand Down
2 changes: 1 addition & 1 deletion docs/source-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ For most engagements having a single hosted DevOps environment (i.e. Azure DevOp
* [ISE Git details](git-guidance/README.md)details on how to use Git as part of a [ISE](../ISE.md) project.
* [GitHub - Removing sensitive data from a repository](https://help.github.com/articles/removing-sensitive-data-from-a-repository/)
* [How Git Works Pluralsight course](https://www.pluralsight.com/courses/how-git-works)
* [Mastering Git Pluralsight course](https://www.pluralsight.com/courses/master-git)
* [Mastering Git Pluralsight course](https://www.pluralsight.com/courses/mastering-git)
77 changes: 0 additions & 77 deletions linkcheck.json

This file was deleted.

Loading