diff --git a/.github/linters/lychee.toml b/.github/linters/lychee.toml new file mode 100644 index 00000000000..a6e36a6d82b --- /dev/null +++ b/.github/linters/lychee.toml @@ -0,0 +1,36 @@ +# 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 = ["docs/api/javadoc/sql/org/apache/sedona/sql/utils/index.html$", + "docs/api/scaladoc/spark/org/apache/sedona/sql/utils/index.html$", + "docs/javadoc/spark", + "docs/scaladoc/spark/org/apache/sedona/sql/utils/index.html$", + "spark://localhost:.*", + "https://dl.acm.org/doi/abs/10.1145/3318464.3389701", + "https://github.com/apache/sedona/tree/master/examples/spark-viz", + "https://github.com/apache/sedona/tree/master/examples/viz", + "https://issues.apache.org/jira.*", + "https://keyserver.pgp.com/.*", + "http://localhost:.*", + "https://mvnrepository.com/.*", + "https://whimsy.apache.org/officers/acreq.*", + "https://whimsy.apache.org/roster/pmc/sedona.*", + "https://www.datasyslab.net/", + "https://www.java.com/", + "https://www.researchgate.net/figure/Relation-between-the-cartesian-axes-x-y-and-i-j-axes-of-the-pixels_fig3_313860913", + "https://www.youtube.com/.*", + "https://x.com/ApacheSedona"] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3dc86839516..90a07380dce 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. +# https://pre-commit.com/ name: Lint on: [pull_request] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c10de0abb4..fc60118285b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -233,6 +233,14 @@ repos: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] exclude: ^docs-overrides/main\.html$|\.Rd$ + - repo: https://github.com/lycheeverse/lychee.git + rev: lychee-v0.18.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$ - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.45.0 hooks: diff --git a/Makefile b/Makefile index b861ed228cd..cee66033236 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ PIP := $(PYTHON) -m pip MKDOCS := mkdocs MIKE := mike -.PHONY: check checkinstall checkupdate install docsinstall docsbuild clean test +.PHONY: check checkinstall checklinks checkupdate install docsinstall docsbuild clean test check: @echo "Running pre-commit checks..." @@ -28,7 +28,7 @@ check: echo "Error: pre-commit is not installed. Run 'make checkinstall' first."; \ exit 1; \ fi - pre-commit run --all-files + SKIP=lychee pre-commit run --all-files checkinstall: @echo "Installing pre-commit..." @@ -37,6 +37,9 @@ checkinstall: fi pre-commit install +checklinks: + pre-commit run lychee --all-files + checkupdate: checkinstall @echo "Updating pre-commit hooks..." pre-commit autoupdate diff --git a/docs/api/flink/Function.md b/docs/api/flink/Function.md index f09fe9ca34d..92a6262c6c7 100644 --- a/docs/api/flink/Function.md +++ b/docs/api/flink/Function.md @@ -3668,7 +3668,7 @@ SRID=4326;POLYGON ((0 0, -0.8390715290764524 0, -0.8390715290764524 1, 0 0)) ## ST_S2CellIDs Introduction: Cover the geometry with Google S2 Cells, return the corresponding cell IDs with the given level. -The level indicates the [size of cells](https://s2geometry.io/resources/s2cell_statistics.html). With a bigger level, +The level indicates the [size of cells](http://s2geometry.io/resources/s2cell_statistics.html). With a bigger level, the cells will be smaller, the coverage will be more accurate, but the result size will be exponentially increasing. Format: `ST_S2CellIDs(geom: Geometry, level: Integer)` diff --git a/docs/api/snowflake/vector-data/Function.md b/docs/api/snowflake/vector-data/Function.md index 55836a8edda..6bbbdc493b2 100644 --- a/docs/api/snowflake/vector-data/Function.md +++ b/docs/api/snowflake/vector-data/Function.md @@ -2836,7 +2836,7 @@ SRID=4326;POLYGON ((0 0, -0.8390715290764524 0, -0.8390715290764524 1, 0 0)) ## ST_S2CellIDs Introduction: Cover the geometry with Google S2 Cells, return the corresponding cell IDs with the given level. -The level indicates the [size of cells](https://s2geometry.io/resources/s2cell_statistics.html). With a bigger level, +The level indicates the [size of cells](http://s2geometry.io/resources/s2cell_statistics.html). With a bigger level, the cells will be smaller, the coverage will be more accurate, but the result size will be exponentially increasing. Format: `ST_S2CellIDs(geom: geometry, level: Int)` diff --git a/docs/api/sql/Function.md b/docs/api/sql/Function.md index e35f5d104db..cc3e18f6b6a 100644 --- a/docs/api/sql/Function.md +++ b/docs/api/sql/Function.md @@ -3852,7 +3852,7 @@ SRID=4326;POLYGON ((0 0, -0.8390715290764524 0, -0.8390715290764524 1, 0 0)) ## ST_S2CellIDs Introduction: Cover the geometry with Google S2 Cells, return the corresponding cell IDs with the given level. -The level indicates the [size of cells](https://s2geometry.io/resources/s2cell_statistics.html). With a bigger level, +The level indicates the [size of cells](http://s2geometry.io/resources/s2cell_statistics.html). With a bigger level, the cells will be smaller, the coverage will be more accurate, but the result size will be exponentially increasing. Format: `ST_S2CellIDs(geom: Geometry, level: Integer)`