manuals: add initial stylechecks with Vale
PATCH 1/1 manuals: add initial stylechecks with Vale
From: Michael Opdenacker <[email protected]>
Use the "Vale" (https://vale.sh) tool to perform text style checks Run "make stylecheck" to run the checks.
This just checks the text, not the Sphinx syntax style choices.
Signed-off-by Michael Opdenacker <[email protected]>
Suggested-by Thomas Petazzoni <[email protected]>
---
See https://lwn.net/Articles/964075/ for a recent introduction. Don't hesitate to run the checks, propose fixes for the reported issues and improvements to the checking rules and accepted words!
Changes in V2:
- Replace "vale init" (wrong) by "vale sync"
to get download the latest versions of the style files
--- documentation/.gitignore | 2 ++ documentation/.vale.ini | 7 +++++++ documentation/Makefile | 9 ++++++++- documentation/README | 14 ++++++++++++++ documentation/standards.md | 15 +++++++++++++++ .../config/vocabularies/OpenSource/accept.txt | 4 ++++ .../styles/config/vocabularies/Yocto/accept.txt | 4 ++++ 7 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 documentation/.vale.ini create mode 100644 documentation/styles/config/vocabularies/OpenSource/accept.txt create mode 100644 documentation/styles/config/vocabularies/Yocto/accept.txt
documentation/.gitignore +2 -0
@@ -7,3 +7,5 @@ releases.rst .vscode/ */svg/*.png */svg/*.pdf +styles/* +!styles/config
documentation/.vale.ini new file +7 -0
@@ -0,0 +1,7 @@ +StylesPath = styles +MinAlertLevel = suggestion +Packages = RedHat, proselint, write-good, alex, Readability, Joblint +Vocab = Yocto, OpenSource +[*.rst] +BasedOnStyles = Vale, RedHat, proselint, write-good, alex, Readability, Joblint +
documentation/Makefile +8 -1
@@ -5,6 +5,9 @@ # from the environment for the first two. SPHINXOPTS ?= -W --keep-going -j auto SPHINXBUILD ?= sphinx-build +# Release notes are excluded because they contain contributor names and commit messages which can't be modified +VALEOPTS ?= --no-wrap --no-wrap --glob '!migration-guides/release-notes-*.rst' +VALEDOCS ?= . SOURCEDIR = . IMAGEDIRS = */svg BUILDDIR = _build
@@ -20,7 +23,7 @@ endif help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: all help Makefile clean publish epub latexpdf +.PHONY: all help Makefile clean stylecheck publish epub latexpdf publish: Makefile html singlehtml rm -rf $(BUILDDIR)/$(DESTDIR)/
@@ -46,6 +49,10 @@ PNGs := $(foreach dir, $(IMAGEDIRS), $(patsubst %.svg,%.png,$(wildcard $(SOURCED clean: @rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js +stylecheck: + vale sync + vale $(VALEOPTS) $(VALEDOCS) + epub: $(PNGs) $(SOURCEDIR)/set_versions.py @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
documentation/README +14 -0
@@ -151,6 +151,20 @@ dependencies in a virtual environment: $ pipenv install $ pipenv run make html +Style checking the Yocto Project documentation +============================================== + +The project is starting to use Vale (https://vale.sh/) +to validate the text style. + +To install Vale: + + $ pip install vale + +To run Vale: + + $ make stylecheck + Sphinx theme and CSS customization ==================================
documentation/standards.md +15 -0
@@ -5,6 +5,21 @@ documentation is created. It is currently a work in progress. +## Automatic style validation + +There is an ongoing effort to automate style validation +through the [Vale](https://vale.sh/). To try it, run: + + $ make vale + +Note that this just applies to text. Therefore, the syntax +conventions described below still apply. + +If you wish to add words to the "accept.txt" files +(./styles/config/vocabularies/<Vocab>/accept.txt), +make sure the spelling and capitalization matches +what Wikipedia uses. Wikipedia is our reference! + ## Text standards ### Bulleted lists
documentation/styles/config/vocabularies/OpenSource/accept.txt new file +4 -0
@@ -0,0 +1,4 @@ +ftrace +toolchain +systemd +LTTng
documentation/styles/config/vocabularies/Yocto/accept.txt new file +4 -0
@@ -0,0 +1,4 @@ +Yocto +BSP +BitBake +OpenEmbedded
Signature · 1 line
2.34.1