diff --git a/.github/linters/lychee.toml b/.github/linters/lychee.toml new file mode 100644 index 000000000000..01ff25c54696 --- /dev/null +++ b/.github/linters/lychee.toml @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +exclude = [ + "https://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.1/html/Release_Notes/version-4.2.html#issues-fixed-4.2.1", + "https://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.2.0/html/Release_Notes/index.html", + "https://cloudstack.apache.org/survey.html", + "https://downloads.chef.io/chef-dk/", + "https://github.com/YOUR_ACCOUNT/cloudstack", + "https://iconka.com/en/downloads/cat-power/", + "https://issues.apache.org/.*", + "http://localhost:5050/", + "https://markmail.org/.*", + "https://viserjs.github.io/docs.html#/viser/guide/installation"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ff8e29f6262..53fbf3d5d9b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -138,3 +138,12 @@ repos: types: [yaml] files: \.ya?ml$ exclude: ^.*k8s-.*\.ya?ml$ + - repo: https://github.com/lycheeverse/lychee.git + rev: lychee-v0.20.1 + hooks: + - id: lychee + name: run lychee + description: run lychee a fast, async, stream-based link checker written in Rust + args: [--config=.github/linters/lychee.toml] + files: \.md$ + stages: [manual] diff --git a/PRE-COMMIT.md b/PRE-COMMIT.md index 9b76929d4223..62dc296c99e4 100644 --- a/PRE-COMMIT.md +++ b/PRE-COMMIT.md @@ -20,7 +20,7 @@ # pre-commit We run [pre-commit](https://pre-commit.com/) with -[GitHub Actions](https://github.com/apache/cloudstack/blob/main/.github/workflows/linter.yml) so installation on your +[GitHub Actions](https://github.com/apache/cloudstack/blob/main/.github/workflows/pre-commit.yml) so installation on your local machine is currently optional. The `pre-commit` [configuration file](https://github.com/apache/cloudstack/blob/main/.pre-commit-config.yaml)