Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add spellcheck #1042

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ CONTAINER_TOOL ?= docker
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec

include cspell/Makefile

.PHONY: all
all: build

Expand Down
12 changes: 12 additions & 0 deletions cspell/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:lts-alpine3.20

ENV PATH="/home/node/node_modules/.bin:$PATH"

WORKDIR /home/node

COPY package.json .
COPY package-lock.json .

RUN npm ci

WORKDIR /victoriametrics
24 changes: 24 additions & 0 deletions cspell/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# These commands must be run from the operator repository root.

# Builds cspell image.
cspell-install:
@ (docker inspect cspell > /dev/null) || (docker build cspell --tag cspell)

# Checks for spelling errors.
cspell-check: cspell-install
@CMD="cspell --no-progress || true" $(MAKE) cspell-run-command

# Runs spelling error check.
# A user facing alias to cspell-check command.
spellcheck: cspell-check

# Runs cspell container commands.
cspell-run-command:
@cp cspell/cspell.json cspell.json
@-docker run \
--entrypoint /bin/sh \
--mount type=bind,src=".",dst=/victoriametrics \
--rm \
--tty \
cspell -c "$(CMD)"
@rm cspell.json
12 changes: 12 additions & 0 deletions cspell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Spell checking

This directory contains configuration and instructions for spell checking in
[docs](https://github.com/VictoriaMetrics/operator/tree/master/docs) folder.

To run execute the following command:

```sh
make cspell-check
```

This command required Docker to build `cspell` image and run the spell checks.
67 changes: 67 additions & 0 deletions cspell/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"allowCompoundWords": true,
"caseSensitive": false,
"language": "en,ru,uk",
"minWordLength": 3,
"dictionaryDefinitions": [
{
"addWords": true,
"name": "custom-dict",
"path": "cspell/custom-dict.txt"
}
],
"dictionaries": [
"aws",
"bash",
"companies",
"cpp",
"css",
"custom-dict",
"data-science",
"docker",
"dotnet",
"en_us",
"en-common-misspelling",
"fonts",
"fullstack",
"golang",
"html",
"k8s",
"makefile",
"misc",
"npm",
"people-names",
"python",
"ru_RU",
"rust",
"software-terms",
"uk_UA",
"win32"
],
"enabled": true,
"files": ["docs/**/*.md"],
"ignoreRegExpList": [
// Github usernames
"/@[a-zA-Z0-9-_]+/i",
// Tokens
"/Authorization:\\sBearer\\s[a-zA-Z0-9-_=]+\\.[a-zA-Z0-9-_=]+\\.[a-zA-Z0-9-_=]+/",
"/(user|password|token):\\s\"?[a-zA-Z0-9-_<>=\\.]+\"?/",
// Victoria Metrics related names
"/vm[a-zA-Z0-9-_]+/i"
],
"import": [
"/home/node/node_modules/@cspell/dict-aws/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-companies/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-data-science/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-en_us/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-fullstack/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-golang/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-k8s/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-people-names/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-ru_ru/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-software-terms/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-uk-ua/cspell-ext.json",
"/home/node/node_modules/@cspell/dict-win32/cspell-ext.json"
],
"useGitignore": true
}
25 changes: 25 additions & 0 deletions cspell/custom-dict.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Aecio
ampl
Amz
apiextensionsv
appsv
aps
Asafs124142
ays
betav
bxc
crds
eeks
Folz
giv
jimmidyson
keyсoncepts
metav
MHI
nn
otlpmetric
otlpmetrichttp
sgn
xzf
ошиб
vcpu
Loading
Loading