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

Reorganize custom dictionaries, better spell checking infra #36255

Merged
merged 15 commits into from
Oct 31, 2024

Conversation

Josh-Cena
Copy link
Member

This should be merged after my fleet of typo fix PRs.

This PR splits our custom dictionaries by topic, making them easier to maintain and inspect. It could also allow for more granular options in the future, such as whether each one should provide suggestions, or whether they should be case-sensitive.

@OnkarRuikar @bsmth

@Josh-Cena Josh-Cena requested review from a team as code owners October 7, 2024 23:32
@Josh-Cena Josh-Cena requested review from pepelsbey and removed request for a team October 7, 2024 23:32
@github-actions github-actions bot added the system [PR only] Infrastructure and configuration for the project label Oct 7, 2024
@Josh-Cena Josh-Cena requested review from bsmth and removed request for a team and pepelsbey October 7, 2024 23:33
@github-actions github-actions bot added the size/xl [PR only] >1000 LoC changed label Oct 7, 2024
@Josh-Cena Josh-Cena marked this pull request as draft October 7, 2024 23:33
@OnkarRuikar
Copy link
Contributor

Give me 2-3 days.

@OnkarRuikar
Copy link
Contributor

command [filePaths...]

You are using both ellipsis and plural from of the word.

How to denote at least one file is required? command <filePath> [filePath...]? I think command [filePath]... does that.

@Josh-Cena
Copy link
Member Author

Huh, the GH actions shell does not automatically expand glob patterns. That's inconvenient.

@Josh-Cena
Copy link
Member Author

You are using both ellipsis and plural from of the word.

How to denote at least one file is required? command <filePath> [filePath...]? I think command [filePath]... does that.

This is the description format as used by commander.js

.vscode/cspell.json Outdated Show resolved Hide resolved
@OnkarRuikar
Copy link
Contributor

In writing docs we need to explain following points:

  • when to use cSpell inline ignore comments in content
  • the purpose of each dictionary
  • nuances like cities are to be put in cultural-words but towns and places in proper-name. We don't want to suggest small towns and places but want countries and cities etc.

I am waiting on content fixes to merge to check regex and other codes.

@OnkarRuikar
Copy link
Contributor

Huh, the GH actions shell does not automatically expand glob patterns. That's inconvenient.

You can specify shell to a task:

jobs:
  name-of-job:
    runs-on: ubuntu-latest
    steps:
      - name: Hello world
        shell: pwsh
        run: |
          write-output "Hello World"

steps:
  - name: Display the path
    run: |
      import os
      print(os.environ['PATH'])
    shell: python

steps:
  - name: Display the path
    run: echo $PATH
    shell: bash

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Oct 15, 2024
@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Oct 26, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Oct 28, 2024
@Josh-Cena Josh-Cena marked this pull request as ready for review October 28, 2024 15:43
@Josh-Cena Josh-Cena requested a review from a team as a code owner October 28, 2024 15:43
@github-actions github-actions bot added the Content:Learn:Cross-Browser-Testing Learning area Cross-Browser-Testing docs label Oct 28, 2024
Copy link
Contributor

github-actions bot commented Oct 28, 2024

Preview URLs

External URLs (1)

URL: /en-US/docs/MDN/Writing_guidelines/Writing_style_guide
Title: Writing style guide

(comment last updated: 2024-10-31 02:20:13)

@Josh-Cena
Copy link
Member Author

In writing docs we need to explain following points:

Which docs are you referring to? The comments and descriptions in the cSpell config?

Co-authored-by: Onkar Khadangale <[email protected]>
Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

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

Looking good, leaving a +1, shall we wait for Onkar to have a look or are we ready to merge?

@Josh-Cena
Copy link
Member Author

Will merge once @OnkarRuikar also gives a thumbsup

Copy link
Contributor

@OnkarRuikar OnkarRuikar left a comment

Choose a reason for hiding this comment

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

A few suggestions and questions. I was waiting for related content changes to merge.

In writing docs we need to explain following points:

Which docs are you referring to? The comments and descriptions in the cSpell config?

In the spellings section in writing guidelines we could have short description of cspell and dictionaries. And can mention the command to check spellings manually:

npx cspell --no-progress --gitignore --config .vscode/cspell.json "**/*.md"

.vscode/cspell.json Outdated Show resolved Hide resolved
media.getusermedia
media.mediasource
media.peerconnection
media.peerconnection.rtpsourcesapi
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
media.peerconnection.rtpsourcesapi
rtpsourcesapi

Why put the entire fully qualified name? Adding the interface name should be sufficient, right?
There are multiple occurrences of these like dom.abortablepromise.

One word per line will keep it simple and reduce the dictionary size significantly.

Copy link
Member Author

@Josh-Cena Josh-Cena Oct 30, 2024

Choose a reason for hiding this comment

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

These are Firefox preferences. I add the prefix to prevent abortablepromise being a valid word on its own; I want the ignored words to be as contextualized and specific as possible because it's always easier to fix false positives than catch false negatives.

Copy link
Contributor

Choose a reason for hiding this comment

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

I add the prefix to prevent abortablepromise being a valid word on its own

I see. 👍

It would be great if this feature/case is documented somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added a sentence to cspell.json's comment:

// Note: when adding words to these lists, be as specific and contextualized
    // as possible, to avoid typos being masked elsewhere. For example, all FF
    // preferences should include prefixes: `dom.abortablepromise` instead of
    // just `abortablepromise`, which may be missing a space in other contexts.

emodeng
emptytext
emsdk
enable-tracejit
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
enable-tracejit
tracejit

We don't have to put the entire term. Same for color-CBDT etc.

Copy link
Member Author

@Josh-Cena Josh-Cena Oct 30, 2024

Choose a reason for hiding this comment

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

Again, tracejit should not be a word unless there's evidence that we actually write it. The only valid usage is in the whole context of enable-tracejit—other than that it should be a typo.

@@ -0,0 +1,302 @@
219ffwef9w0f
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
219ffwef9w0f

Like "sessionid=\\w+", can we add Set-Cookie: .*? qwerty=\\w+

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't want to do this because Set-Cookie could contain legitimate words in the attribute names.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, it makes no sense to add regex if there is only one instance.

boxbg
BRAH
bram.us
bruce_vs_ironman
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bruce_vs_ironman
ironman

Copy link
Member Author

Choose a reason for hiding this comment

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

Again ironman is not a valid word. It's "Iron Man". It's only valid in this particular file name because I don't want to change it.

scripts/sort_and_unique_file_lines.js Outdated Show resolved Hide resolved
@github-actions github-actions bot added the Content:Meta Content in the meta docs label Oct 30, 2024
Copy link
Member

Choose a reason for hiding this comment

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

Super, thank you 👍🏻

Copy link
Contributor

@OnkarRuikar OnkarRuikar left a comment

Choose a reason for hiding this comment

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

One nit

Copy link
Contributor

@OnkarRuikar OnkarRuikar left a comment

Choose a reason for hiding this comment

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

The PR changes look good to me. Thanks for taking on this monumental task!

@Josh-Cena
Copy link
Member Author

Great, let's go!

@Josh-Cena Josh-Cena merged commit 753e6ce into main Oct 31, 2024
13 of 14 checks passed
@Josh-Cena Josh-Cena deleted the refactor-dicts branch October 31, 2024 02:19
@bsmth
Copy link
Member

bsmth commented Oct 31, 2024

Well done 👏🏻

fiji-flo pushed a commit that referenced this pull request Oct 31, 2024
* Reorganize custom dictionaries, better spell checking infra

* Update scripts/sort_and_unique_file_lines.js

* Reorg files

* Updates

* Apply suggestions from code review

Co-authored-by: Onkar Khadangale <[email protected]>

* Typo

* Fix action

* Fix checkout

* Update scripts/sort_and_unique_file_lines.js

Co-authored-by: Onkar Khadangale <[email protected]>

* Update .vscode/cspell.json

Co-authored-by: Onkar Khadangale <[email protected]>

* Add docs

* Update files/en-us/mdn/writing_guidelines/writing_style_guide/index.md

Co-authored-by: Onkar Khadangale <[email protected]>

---------

Co-authored-by: Onkar Khadangale <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn:Cross-Browser-Testing Learning area Cross-Browser-Testing docs Content:Meta Content in the meta docs size/xl [PR only] >1000 LoC changed system [PR only] Infrastructure and configuration for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants