From a6fce246cdac73e7bfd2ceda533bbae125482ffa Mon Sep 17 00:00:00 2001 From: Ledio Berdellima Date: Sun, 10 May 2026 23:05:09 +0100 Subject: [PATCH] ci: catch broken markdown links --- .github/workflows/pull_request.yml | 4 ++-- .lycheeignore | 4 ++++ .pre-commit-config.yaml | 9 +++++++++ ACKNOWLEDGMENTS.md | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .lycheeignore diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c00c2c19..bdd401bb 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -64,10 +64,10 @@ jobs: run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Run style checks + - name: Run style and markdown link checks shell: sh run: | - pre-commit run --all || (echo "Style checks failed, please install pre-commit and run pre-commit run --all and push the change"; echo ""; git --no-pager diff; exit 1) + pre-commit run --all || (echo "Style or markdown link checks failed, please install pre-commit and run pre-commit run --all and push the change"; echo ""; git --no-pager diff; exit 1) docs: needs: lint diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 00000000..5ec98084 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,4 @@ +^file://.*/Source/Cmlx/fmt/.* +^file://.*/Source/Cmlx/json/.* +^file://.*/Source/Cmlx/metal-cpp/.* +^file://.*/Source/(MLX|MLXNN|MLXOptimizers)/Documentation\.docc/(mlx|mlxnn|mlxoptimizers)$ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70b05a86..d714bb8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,3 +13,12 @@ repos: rev: v0.6.10 hooks: - id: cmake-format + +- repo: https://github.com/lycheeverse/lychee.git + rev: lychee-v0.24.2 + hooks: + - id: lychee + args: + - --no-progress + - --offline + types: [markdown] diff --git a/ACKNOWLEDGMENTS.md b/ACKNOWLEDGMENTS.md index 80f0b893..a14e8201 100644 --- a/ACKNOWLEDGMENTS.md +++ b/ACKNOWLEDGMENTS.md @@ -7,6 +7,8 @@ with a short description of your contribution(s) below. For example: MLX Swift was developed with contributions from the following individuals: +- [Ledio Berdellima](https://github.com/x-n2o): Added Markdown link checks in pre-commit/CI. +