Skip to content

Commit

Permalink
HDDS-10667. Improvements to spelling checks. (apache#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
errose28 authored Apr 16, 2024
1 parent df804aa commit eebd323
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .github/resource/spelling_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
Spelling can be checked locally by running the script *.github/scripts/spelling.sh*. This requires you to have pnpm's dev dependencies installed on your machine for cspell to work (run `pnpm install --dev`).

**If spell check fails for words that are correct but not recognized:**
- Option 1: If the word is relevant for the whole Ozone project, add it to the `words` list in *cspell.yaml* so that it is considered valid.
- Option 2: If the word is only relevant for one specific page, add an [inline directive](https://cspell.org/configuration/document-settings/) as a comment in the markdown frontmatter of that page only.

- Option 1: If the word is relevant for the whole Ozone project, add it to the `words` list in *cspell.yaml* so that it is considered valid.
- Option 2: If the word is only relevant for one specific page, add an [inline directive](https://cspell.org/configuration/document-settings/) as a comment in the markdown front matter of that page only.
10 changes: 8 additions & 2 deletions .github/scripts/spelling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ root="$(git rev-parse --show-toplevel)"

rc=0

echo 'Checking document content...'
printf '%s\n' 'Checking document content...'
pnpm cspell lint --root="$root" --no-progress --show-context '**/*.md' '**/_category_.yml' || rc="$?"

echo 'Checking file names...'
printf '\n%s\n' 'Checking file names...'
find "$root"/docs "$root"/src/pages | pnpm cspell --no-progress --show-context stdin://'File Name' || rc="$?"

if [ "$rc" != 0 ]; then
# TODO Update this link to master when the new website's branch is merged.
printf '\n%s\n%s\n' 'Spell check failed. See CONTRIBUTING.md for help fixing false positive spelling errors:' \
'https://github.com/apache/ozone-site/blob/HDDS-9225-website-v2/CONTRIBUTING.md#spelling' 1>&2
fi

exit $rc
19 changes: 12 additions & 7 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ proper-names:
- CLI
- RPC
- EC
- BCSID
- SPNEGO
- SASL
- TLS
Expand All @@ -103,14 +104,18 @@ proper-names:
- pnpm
- S3
- Hadoop
# Enforce capitalization for these words only when they are used in sentences (surrounded by spaces).
- UUID
- IP address
# Enforce capitalization for these words only when they are used in sentences (preceded by a space).
# Other uses in repo names or links like [apache/ozone](https://github.com/apache/ozone) are ok.
- " Ratis "
- " Ozone "
- " Apache "
- " ASF "
- " HTTP "
- " HTTPS "
- " Ratis"
- " Ozone"
- " Apache"
- " ASF"
- " HTTP"
- " http:"
- " HTTPS"
- " https:"

# Indentation should not be used to indicate a multi-line code block.
code-block-style:
Expand Down
11 changes: 11 additions & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import:
- "@cspell/dict-shell/cspell-ext.json"
- "@cspell/dict-docker/cspell-ext.json"

flagWords:
# Write "quasi-closed" instead of "quasi closed".
- quasi

# List of words to be always considered correct.
# Case insensitive.
words:
Expand All @@ -51,6 +55,13 @@ words:
- OBS
- HttpFS
- safemode
- mis-replicate
- mis-replication
- mis-replicated
- BCSID
- EC
- quasi-close
- quasi-closed
# Other systems' words
- KDC
- classpath
Expand Down

0 comments on commit eebd323

Please sign in to comment.