Skip to content

Commit

Permalink
feat: 🎸 Use lychee instead of markdown-link-checker
Browse files Browse the repository at this point in the history
Instead of running a pre-commit hook for the link-checker, run lychee on
the Lint.yml workflow. Also set the docs linkcheck to false.

✅ Closes: #160
  • Loading branch information
abelsiqueira committed Jun 6, 2024
1 parent c536ead commit 5e6006f
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 39 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ jobs:
run: pip install pre-commit
- name: Run pre-commit
run: SKIP=no-commit-to-branch pre-commit run -a
link-checker:
name: Link checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
fail: true
7 changes: 0 additions & 7 deletions .markdown-link-config.json

This file was deleted.

6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,3 @@ repos:
rev: v1.0.56
hooks:
- id: julia-formatter
- repo: https://github.com/tcort/markdown-link-check
rev: v3.12.2
hooks:
- id: markdown-link-check
args:
- --config=.markdown-link-config.json
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning].

<!-- markdownlint-disable MD024 -->

## [Unreleased]
## [0.4.1]

### Added

Expand Down Expand Up @@ -211,9 +211,8 @@ and this project adheres to [Semantic Versioning].
[semantic versioning]: https://semver.org/spec/v2.0.0.html

<!-- Versions -->
<!-- markdown-link-check-disable -->

[unreleased]: https://github.com/abelsiqueira/COPIERTemplate.jl/compare/v0.4.0...HEAD
[0.4.1]: https://github.com/abelsiqueira/COPIERTemplate.jl/releases/tag/v0.4.1
[0.4.0]: https://github.com/abelsiqueira/COPIERTemplate.jl/releases/tag/v0.4.0
[0.3.2]: https://github.com/abelsiqueira/COPIERTemplate.jl/releases/tag/v0.3.2
[0.3.1]: https://github.com/abelsiqueira/COPIERTemplate.jl/releases/tag/v0.3.1
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ If you would like to get involved in the COPIERTemplate growth, please check our
If your interest is in developing the package, check the [development guide](docs/src/90-developer.md) as well.

### Contributors
<!-- markdown-link-check-disable -->

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end
makedocs(;
modules = [COPIERTemplate],
doctest = true,
linkcheck = true,
linkcheck = false,
authors = "Abel Soares Siqueira <[email protected]> and contributors",
repo = "https://github.com/abelsiqueira/COPIERTemplate.jl/blob/{commit}{path}#{line}",
sitename = "COPIERTemplate.jl",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/20-explanation.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Installing pre-commit (`pre-commit install`) will make sure that it runs the rel
Furthermore, if you run `pre-commit run -a`, it runs all hooks.

Some hooks in the `.pre-commit-config.yaml` file have configuration files of their own:
`.JuliaFormatter.toml`, `.markdownlint.json`, `.markdown-link-config.json`, and `.yamllint.yml`.
`.JuliaFormatter.toml`, `.markdownlint.json`, `.lycheeignore`, and `.yamllint.yml`.

Also slightly related, is the `.editorconfig` file, which tells your editor, if you install the correct plugin, how to format some things.

Expand Down
1 change: 0 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ If your interest is in developing the package, check the [development guide](90-
## Contributors

```@raw html
<!-- markdown-link-check-disable -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
Expand Down
9 changes: 9 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exclude = [
"@ref",
"^https://github.com/.*/releases/tag/v.*$"
]

exclude_path = [
"docs/build",
"test/conda-env"
]
11 changes: 11 additions & 0 deletions template/.github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ jobs:
run: pip install pre-commit
- name: Run pre-commit
run: SKIP=no-commit-to-branch pre-commit run -a
link-checker:
name: Link checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
fail: true
7 changes: 0 additions & 7 deletions template/.markdown-link-config.json

This file was deleted.

6 changes: 0 additions & 6 deletions template/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,3 @@ repos:
rev: v1.0.56
hooks:
- id: julia-formatter
- repo: https://github.com/tcort/markdown-link-check
rev: v3.12.2
hooks:
- id: markdown-link-check
args:
- --config=.markdown-link-config.json
3 changes: 0 additions & 3 deletions template/README.md.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# {{ PackageName }}

<!-- This check was disabled because these links don't exist until you push, create documentation, and create your first release -->
<!-- markdown-link-check-disable -->
[![Stable Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/stable)
[![In development documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/dev)
[![Build Status](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/workflows/Test/badge.svg)](https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/actions)
Expand All @@ -24,8 +23,6 @@ If you want to make contributions of any kind, please first that a look into our

{% if AddAllcontributors %}### Contributors

<!-- markdown-link-check-disable -->

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
Expand Down
2 changes: 1 addition & 1 deletion template/docs/make.jl.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end
makedocs(;
modules = [{{ PackageName }}],
doctest = true,
linkcheck = true,
linkcheck = false, # Rely on Lint.yml/lychee for the links
authors = "{{ AuthorName }} <{{ AuthorEmail }}> and contributors",
repo = "https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/{commit}{path}#{line}",
sitename = "{{ PackageName }}.jl",
Expand Down
2 changes: 0 additions & 2 deletions template/docs/src/index.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Documentation for [{{ PackageName }}](https://github.com/{{ PackageOwner }}/{{ P

{% if AddAllcontributors %}## Contributors

<!-- markdown-link-check-disable -->

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
Expand Down
11 changes: 11 additions & 0 deletions template/lychee.toml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
exclude = [
"@ref",
"^https://github.com/.*/releases/tag/v.*$",
"^https://doi.org/FIXME$",
"^https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl/stable$",
"zenodo.org/badge/DOI/FIXME$"
]

exclude_path = [
"docs/build"
]

0 comments on commit 5e6006f

Please sign in to comment.