forked from canonical/opensearch-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.docs
More file actions
74 lines (57 loc) · 2.19 KB
/
Makefile.docs
File metadata and controls
74 lines (57 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
# Minimal makefile for documentation
#
# Vale settings
VALE_DIR ?= .vale
PRAECEPTA_CONFIG ?= .vale.ini
DOCS_FILES ?= README.md CONTRIBUTING.md
HAS_VALE := $(shell command -v vale;)
HAS_LYCHEE := $(shell command -v lychee;)
# ==============================================================================
# Docs Targets
# ==============================================================================
.PHONY: docs-check
docs-check: vale lychee ## Run all Docs checks
.PHONY: docs-clean
docs-clean: vale-clean
# ==============================================================================
# Dependency Check Targets
# ==============================================================================
.PHONY: .check-vale
.check-vale:
ifndef HAS_VALE
$(call errmsg,'vale' is not installed. Please install it first) \
exit 1;
endif
.PHONY: .check-lychee
.check-lychee:
ifndef HAS_LYCHEE
$(call errmsg,'lychee' is not installed. Please install it first) \
exit 1;
endif
# ==============================================================================
# Main Vale Targets
# ==============================================================================
.PHONY: vale-sync
vale-sync: ## Download and install external Vale configuration sources
$(call msg,--- Syncing Vale styles... ---)
@vale sync
.PHONY: vale
vale: .check-vale vale-sync ## Run Vale checks on docs
$(call msg,--- Running Vale checks on "$(DOCS_FILES)"... ---)
@vale --config=$(PRAECEPTA_CONFIG) $(DOCS_FILES)
# ==============================================================================
# Main Lychee Targets
# ==============================================================================
.PHONY: lychee
lychee: .check-lychee ## Run Lychee checks on docs
$(call msg,--- Running lychee checks on "$(LYCHEE_DOCS_FILES)"... ---)
@lychee $(DOCS_FILES)
# ==============================================================================
# Helper Targets
# ==============================================================================
.PHONY: vale-clean
vale-clean:
$(call msg,--- Cleaning downloaded packages and ignored files from "$(VALE_DIR)"... ---)
@git clean -dfX $(VALE_DIR)