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

Automated spellcheck for docs via GitHub Actions (and address all raised issues) #2144

Merged
merged 31 commits into from
Oct 13, 2022

Conversation

SeanKilleen
Copy link
Contributor

Hi all,

Wanted to do a PR that I hope will be useful and quick. I've been theming my contributions lately and am aiming to contribute this as I've contributed it to NUnit, Marten, Akka .NET, Uno Platform, HotChocolate, Prisma,, etc.

This PR:

  • Adds an automated spellcheck for docs files via GitHub Actions (when docs are modified)
  • Aims to address every issue raised (98% of which will be just adding known terms to the dictionary)

If this isn't something you're interested in, that's quite alright -- just let me know and close the PR.

ℹ️ I'll do a self-review prior to this being complete where I'll point out any quirks / ask for choices where such choices exist, etc.

@SeanKilleen
Copy link
Contributor Author

Started with 943 raised issues. Down to 719.

@SeanKilleen SeanKilleen changed the title WIP: Automated spellcheck for docs via GitHub Actions (and address all raised issues) Automated spellcheck for docs via GitHub Actions (and address all raised issues) Oct 10, 2022
branches:
- main
paths:
- "docs/**/*"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ NOTE: Will only run when docs or child items are modified in some way.

"language": "en",
"words": [
"Alloc",
"analyse",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Typically I standardize on en-US because that's the cSpell default. In this case, it seems analyse is pretty "baked in" to the docs so I chose to add it instead. Let me know if you'd like me to adjust to analyze and I will.

{
"version": "0.2",
"language": "en",
"words": [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ NOTE: words in this file will be suggested alongside spellcheck in IDEs that make use of cSpell (e.g. VS Code). ignoreWords will not. I make a best-guess effort to separate the two.

@@ -1,4 +1,5 @@
---
#cspell:ignore configoptions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ In some files where the only issue surfaced was in frontmatter, I used the #cspell:ignore technique to ignore it.

| GlobFilter | Provided glob pattern | `filter` | --filter *Serializer*.ToStream |
| AttributesFilter | Provided attribute names | `attribute` | --attribute STAThread |
| AllCategoriesFilter | All Provided category names | `categories` | --allCategories Priority1 CoreFX |
| AnyCategoriesFilter | Any provided category names | `anycategories` | --anyCategories Json Xml |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ In cases like this, where one of the items (e.g. anycategories) is considered a spelling issue, if possible I resolve it by putting back-ticks around the list of options.

@@ -118,18 +123,24 @@ Basically, it's a good idea to start with predefined values (e.g. `EnvMode.RyuJi

Note that the job cannot be modified after it's added into config. Trying to set a value on property of the frozen job will throw an `InvalidOperationException`. Use the `Job.Frozen` property to determine if the code properties can be altered.

If you do want to create a new job based on frozen one (all predefined job values are frozen) you can use the `.With()` extension method
If you do want to create a new job based on frozen one (all predefined job values are frozen) you can use the `.With()` extension method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ In a few cases, my auto-formatter introduced some whitespace that I didn't think you'd hate, so I just left it in instead of undoing it.

@SeanKilleen SeanKilleen marked this pull request as ready for review October 10, 2022 19:51
@SeanKilleen
Copy link
Contributor Author

OK -- self-review added as a guide to the changes. Please let me know if you've got any questions / concerns!

"Multi-line code blocks",
"HTML Tags"
],
"ignorePaths": [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ I ignore two globs as part of this PR:

  • Changelog -- it usually contains many names, and spelling issues could arise as the result of direct copy/paste. More messy to leave in than to take out typically I find, so I ignore it. If you'd like me to un-ignore it and work through it, I can do that.
  • Team page -- mostly due to the names. However, as above, happy to un-ignore and work through it if that's your preference.

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you for your contribution @SeanKilleen !

@AndreyAkinshin PTAL

on:
push:
branches:
- master
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ FYI I had his as main originally by mistake. Just fixed it.

Copy link
Member

@AndreyAkinshin AndreyAkinshin left a comment

Choose a reason for hiding this comment

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

Currently, the spellcheck workflow fails with

/home/runner/work/BenchmarkDotNet/BenchmarkDotNet/docs/articles/guides/choosing-run-strategy.md:2:11 - Unknown word (runstrategy)
/home/runner/work/BenchmarkDotNet/BenchmarkDotNet/docs/articles/samples/IntroColdStart.md:38:9 - Unknown word (runstrategy)
/home/runner/work/BenchmarkDotNet/BenchmarkDotNet/docs/articles/samples/IntroMonitoring.md:47:9 - Unknown word (runstrategy)
CSpell: Files checked: 105, Issues found: 3 in 3 files

Could you please make it green?

@SeanKilleen
Copy link
Contributor Author

@AndreyAkinshin sorry I missed that. Just pushed the changes to fix it. 👍

@AndreyAkinshin AndreyAkinshin merged commit f8e0a5c into dotnet:master Oct 13, 2022
@AndreyAkinshin
Copy link
Member

@SeanKilleen thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants