Skip to content

Commit

Permalink
Implement deadlink checker for vald web (#2643)
Browse files Browse the repository at this point in the history
* ✨ Implement deadlink checker for vald web

Signed-off-by: vankichi <kyukawa315@gmail.com>

* ♻️ refactor

Signed-off-by: vankichi <kyukawa315@gmail.com>

* style: format code with Gofumpt and Prettier

This commit fixes the style issues introduced in 4f5a181 according to the output
from Gofumpt and Prettier.

Details: #2643

* ♻️ refactor

Signed-off-by: vankichi <kyukawa315@gmail.com>

* 🔧 add make command

Signed-off-by: vankichi <kyukawa315@gmail.com>

* ♻️ Fix

Signed-off-by: vankichi <kyukawa315@gmail.com>

---------

Signed-off-by: vankichi <kyukawa315@gmail.com>
Signed-off-by: Yusuke Kato <kpango@vdaas.org>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Yusuke Kato <kpango@vdaas.org>
  • Loading branch information
3 people authored Sep 30, 2024
1 parent 51283dc commit 413b5d7
Show file tree
Hide file tree
Showing 4 changed files with 886 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ MIRROR_GATEWAY_IMAGE = $(NAME)-mirror-gateway
READREPLICA_ROTATE_IMAGE = $(NAME)-readreplica-rotate
MAINTAINER = "$(ORG).org $(NAME) team <$(NAME)@$(ORG).org>"

DEADLINK_CHECK_PATH ?= ""
DEADLINK_IGNORE_PATH ?= ""
DEADLINK_CHECK_FORMAT = html

DEFAULT_BUILDKIT_SYFT_SCANNER_IMAGE = $(GHCRORG)/$(BUILDKIT_SYFT_SCANNER_IMAGE):nightly

VERSION ?= $(eval VERSION := $(shell cat versions/VALD_VERSION))$(VERSION)
Expand Down Expand Up @@ -447,6 +451,11 @@ dockerfile:
workflow:
$(call gen-workflow,$(ROOTDIR),$(MAINTAINER))

.PHONY: deadlink-checker
## generate deadlink-checker
deadlink-checker:
$(call gen-deadlink-checker,$(ROOTDIR),$(MAINTAINER),$(DEADLINK_CHECK_PATH),$(DEADLINK_IGNORE_PATH),$(DEADLINK_CHECK_FORMAT))

.PHONY: init
## initialize development environment
init: \
Expand Down
17 changes: 17 additions & 0 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,20 @@ define update-github-actions
done
endef

define gen-deadlink-checker
BIN_PATH="$(TEMP_DIR)/vald-deadlink-checker-gen"; \
rm -rf $$BIN_PATH; \
MAINTAINER=$2 \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
go build -modcacherw \
-mod=readonly \
-a \
-tags "osusergo netgo static_build" \
-trimpath \
-o $$BIN_PATH $(ROOTDIR)/hack/tools/deadlink/main.go; \
$$BIN_PATH -path $3 -ignore-path $4 -format $5 $1; \
rm -rf $$BIN_PATH
endef

Loading

0 comments on commit 413b5d7

Please sign in to comment.