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

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

Conversation

errose28
Copy link
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
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
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.

pattern: |
/
^(\s*`{3,}).* # match the ```
[\s\S]*? # the block of code
Copy link
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
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
12 checks passed
@adoroszlai
Copy link
Contributor

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

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