Skip to content

Upgrade to check-spelling v0.0.25 #18940

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented May 22, 2025

Summary of the Pull Request

  • Various spelling fixes
  • Refresh metadata (including dictionaries)
  • Upgrade to v0.0.25

References and Relevant Issues

Detailed Description of the Pull Request / Additional comments

  • Code Scanning action requires a Code Scanning Ruleset -- you'll need to add a ruleset as the modern practice for github code scanning involves workflows not actually ❌ing when they're unhappy, but instead submitting their complaints to the sarif endpoint and relying on the reporting system to handle things.
    • I'd suggest you test it out in a fork before merging this to see how it works, this is a very new feature and it takes some getting used to

Validation Steps Performed

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

@@ -32,9 +41,6 @@ index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40}
# https/http/file urls
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/*%?=~_|!:,.;]+[-A-Za-z0-9+&@#/*%=~_|]

# https/http/file urls
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 item was a mismerge in a previous update...

@@ -270,12 +476,12 @@
\b(?:coarse|fine) grained\b

# Homoglyph (Cyrillic) should be `A`/`B`/`C`/`E`/`H`/`I`/`I`/`J`/`K`/`M`/`O`/`P`/`S`/`T`/`Y`
# It's possible that your content is intentionally mixing Cyrllic and Latin scripts, but if it isn't, you definitely want to correct this.
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've added testing to catch when I make typos ☺️ in this file so there should be fewer of them going forward...

@@ -9,39 +18,127 @@
# Windows Resources with accelerators
\b[A-Z]&[a-z]+\b(?!;)

# bug in check-spelling v0.0.24 (fixed later)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's fixed!

Comment on lines +88 to +112
# hit-count: 5 file-count: 3
# Alternatively, if you're using check-spelling v0.0.25+, and you would like to _check_ the Non-English content for spelling errors, you can. For information on how to do so, see:
# https://docs.check-spelling.dev/Feature:-Configurable-word-characters.html#unicode
[a-zA-Z]*[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]*|[a-zA-Z]{3,}[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]|[ÀÁÂÃÄÅÆČÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæčçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3,}
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 worth thinking about instead of just taking unconditionally.

Samples:

author: Ítalo Masserano arkthur/italo.masserano@gmail.com

// This is the start point of the Bézier curve.

// The wave line is drawn using a cubic Bézier curve (PolyBezier), because that happens to be cheap with GDI.

Copy link
Member

Choose a reason for hiding this comment

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

This is worth thinking about instead of just taking unconditionally.

I'm unfortunately not entirely sure what you meant. Are you referring to how we should not adopt this pattern unconditionally, or that it may have false-positives in general?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'm suggesting that it risks hiding other bugs.

I recently ran into some other repository where someone had an é instead of a ,, this rule would have hidden that.

Copy link
Member

Choose a reason for hiding this comment

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

I'm alright with this - we can always refine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the record, the 3 files and 5 hits are:
doc/specs/#4066 - Theme-controlled color scheme switch.md:

author: Ítalo Masserano arkthur/italo.masserano@gmail.com

src/renderer/gdi/paint.cpp:

   // This is the start point of the Bézier curve.

src/renderer/gdi/state.cpp:

// The wave line is drawn using a cubic Bézier curve (PolyBezier), because that happens to be cheap with GDI.
// We use a Bézier curve where, if the start (a) and end (c) points are at (0,0) and (1,0), the control points are
// We can reverse the above to get back the actual amplitude of our Bézier curve. The line

I think it might make more sense to recognize Bézier (4) and Ítalo (1) in allow/international.txt and drop this rule.

I should probably start adding advice to candidate.patterns for suggested minimum thresholds.... I'll have to think about that.

Anyway, no absolute need to change this... it's just something that has come up periodically, most recently with: https://daniel.haxx.se/blog/2025/05/16/detecting-malicious-unicode/ (although the initial check-spelling/spell-check-this Cyrillic homoglyph rules predate that, and the general concern has been around since at least the introduction of punycode and IDN for DNS).

@@ -28,7 +28,7 @@ public TestResult()
public List<string> Screenshots { get; private set; }
public List<TestResult> RerunResults { get; private set; }
}

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 whitespace change was made by VSCode...

@jsoref jsoref force-pushed the spelling-0.0.25 branch from 529f938 to f8b4ab8 Compare May 22, 2025 16:24
slnt
stakeholders
subpage
sustainability
sxn
TLDR
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 removed by correcting the one instance to TL;DR (see src/types/UiaTextRangeBase.cpp)

toolset
tshe
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 was a legacy shim from 0.0.18 ...

@@ -1,4 +1,3 @@
alice
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is that most of this is covered by cspell:css/css.txt, but I didn't look too closely...

Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

LGTM aside from my comment about oss. Thanks for your works! 😊

@jsoref jsoref force-pushed the spelling-0.0.25 branch from f8b4ab8 to c189e90 Compare May 22, 2025 19:58

This comment has been minimized.

@jsoref jsoref force-pushed the spelling-0.0.25 branch from c189e90 to 88fba1a Compare May 22, 2025 20:03
@@ -692,7 +692,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
// - oldKeys: the key binding that we are rebinding
// - newKeys: the new key chord that is being used to replace oldKeys
// Return Value:
// - true, if successful. False, otherwise.
// - true, if successful. False; otherwise,.
Copy link
Member

Choose a reason for hiding this comment

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

I believe these should be rephrased to False otherwise.; otherwise, this is somewhat of an unusual outcome

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'm currently struggling with true...False.

A quick survey shows it happens ~9 times after Return Value: in the repository (including here).

By contrast True...False happens 98 times.

// - True if ctrl was held. False otherwise.

Even true...false happens more often ~33 times.

Here are some examples:

// - true of light, false if dark
-- this is wrong for another reason -- it should be if not of 🤦 -- note that this was the first one I found while looking for an example of this case
// - true if we handled the event was handled, else false.
// true iff we were able to select that tab index, false otherwise
// - showOrHide: Show is true; hide is false.
-- this is actually before // Return Value: (I'm using VSCode's search w/ 1 line of context above&below)
// - true if partial char data is available, false otherwise

Copy link
Member

Choose a reason for hiding this comment

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

Many of these are great examples for Leonard's "It's capacitity". We seriously overdocument some otherwise obvious stuff and keep doing it out of sheer inertia.

"GetIsEnabled" "Gets whether the thing is enabled" "Arguments: thing - the thing for which to report the enablement status" "Returns: true of the thing is enabled; false, otherwise,."

Now, I alone am the person to blame for using iff.

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 feels like a really good argument for deleting such things.

I think I actually remember that iff from a number of years ago...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For booleans, could I propose replacing the current style with

  • indicates that the thing did what it was supposed to do
     // Return Value:
-    // - true if we handled the event was handled, else false.
+    // ... if true, indicates the event was handled

(This is a real example, and it's a real mess handled...handled)

Programmers should be able to understand binary negation. And the extra words here in so many of these instances seem to be a recipe for making mistakes.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

good lord we say "otherwise" a lot. This is also my new favorite rule. Requesting changes for the weird constructions around the find/replace of otherwise

@@ -269,7 +269,7 @@ static constexpr wchar_t _encodeDefaultCoordinate(const til::CoordType sCoordina
// Parameters:
// - <none>
// Return value:
// - true, if we are tracking mouse input. False, otherwise
// - true, if we are tracking mouse input. False; otherwise,
Copy link
Member

Choose a reason for hiding this comment

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

same as prior

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

forgot to actually click request

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 22, 2025
@jsoref jsoref force-pushed the spelling-0.0.25 branch from 88fba1a to c42e835 Compare May 23, 2025 02:07

This comment has been minimized.

@jsoref jsoref force-pushed the spelling-0.0.25 branch from c42e835 to 8ceff1b Compare May 23, 2025 03:06
jsoref added 9 commits May 22, 2025 23:07
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
jsoref added 15 commits May 22, 2025 23:07
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
@jsoref jsoref force-pushed the spelling-0.0.25 branch from 8ceff1b to 3b09a28 Compare May 23, 2025 03:07
@@ -8,7 +8,7 @@ using namespace winrt::TerminalApp;
// - color: this color is going to be examined whether it
// is light or not
// Return Value:
// - true of light, false if dark
// - true if light, false if dark
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One of the items I ran into accidentally...

Comment on lines -2392 to +2394
// - wrapForced - Set to true is the line feed was the result of the line wrapping. if the viewport panned down. False if not.
// - wrapForced - Set to true if the line feed was the result of the line wrapping.
// Return Value:
// - true if the viewport panned down; otherwise, false.
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 change, more or less, fixes editor damage introduced in 6dd9c46

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