From 181090e4f5a9605d952f5e41f60695db8ab1800c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 28 Feb 2025 12:22:07 +0100 Subject: [PATCH] feat: add a make goal to run vale locally --- CONTRIBUTING.md | 15 +++++++++++++++ Makefile | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index df7ed56a402..f310534c1bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,6 +109,21 @@ $ make validate If this command doesn't result in any errors, you're good to go! +#### Running Vale + +Vale is a tool that checks for spelling and grammar errors in your text. To run Vale +for the content in the `content` directory, use the following command: + +```console +$ make vale +``` + +You can also specify a different directory for Vale to check. For example: + +```console +$ CONTENT_DIR="content/manuals/compose" make vale +``` + ## Content not edited here CLI reference documentation is maintained in upstream repositories. It's diff --git a/Makefile b/Makefile index 4025de3c173..a08f075f81d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,18 @@ +# Directory containing the content to validate. Default is "content". +# It can be overridden by setting the CONTENT_DIR environment variable. +# Example: CONTENT_DIR=content/manuals/compose make vale +CONTENT_DIR := $(or $(CONTENT_DIR), content) + +# Docker image to use for vale. +VALE_IMAGE := jdkato/vale:latest + +.PHONY: vale +vale: ## run vale + docker run --rm -v $(PWD):/docs \ + -w /docs \ + -e PIP_BREAK_SYSTEM_PACKAGES=1 \ + $(VALE_IMAGE) $(CONTENT_DIR) + .PHONY: validate validate: ## run validations docker buildx bake validate