Skip to content

HDDS-11970. Ignore markdown code blocks in cspell#118

Merged
adoroszlai merged 5 commits into
apache:HDDS-9225-website-v2from
errose28:HDDS-11970-ignore-spelling-in-code
Dec 21, 2024
Merged

HDDS-11970. Ignore markdown code blocks in cspell#118
adoroszlai merged 5 commits into
apache:HDDS-9225-website-v2from
errose28:HDDS-11970-ignore-spelling-in-code

Conversation

@errose28
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Right now docs frequently have to add inline spelling ignores to code blocks, especially for command line flags like -Doption. The CSpell docs provide an example pattern to match multi-line markdown code blocks and only apply it to markdown files. We can add this and a similar pattern to ignore inline code blocks and remove all current inline cspell directives from the docs, since they were only needed for code blocks.

What is the link to the Apache Jira?

HDDS-11970

How was this patch tested?

@github-actions github-actions Bot added the website-v2 Tasks for the new ozone website targeting the HDDS-9225-website-v2 branch label Dec 19, 2024
@errose28
Copy link
Copy Markdown
Contributor Author

@jojochuang this should handle the spelling errors you were seeing in other changes.

@errose28 errose28 requested a review from adoroszlai December 19, 2024 23:46
Copy link
Copy Markdown
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Confirmed cspell excludes code blocks.

Comment thread cspell.yaml
pattern: |
/
^(\s*`{3,}).* # match the ```
[\s\S]*? # the block of code
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between [\s\S] and .?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the pattern provided by the cspell docs that I copied here and tested out. ChatGPT says . will not match newlines and [\s\S] is a workaround to catch multi-line code blocks. However, when I tested it locally, . also seemed to work for multiple lines.

@adoroszlai adoroszlai merged commit fc6172b into apache:HDDS-9225-website-v2 Dec 21, 2024
@adoroszlai
Copy link
Copy Markdown
Contributor

Thanks @errose28 for the patch, @jojochuang for the review.

jojochuang pushed a commit to jojochuang/ozone-site that referenced this pull request Jul 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

website-v2 Tasks for the new ozone website targeting the HDDS-9225-website-v2 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants