google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 291 forks source link

Automate spell checking #2504

Open aaemnnosttv opened 3 years ago

aaemnnosttv commented 3 years ago

Feature Description

Currently we have no form of automated test or tooling in place for checking the spelling of user-facing strings. While uncommon, there have been a few spelling errors which have slipped through (#2401).

This would also be useful in catching potential English-specific misspellings (e.g. using en-GB instead of en-US).

As an open-source project with contributors and maintainers from many different countries, it would be useful to leverage some form of automated spell checking using GitHub actions and/or ESLint, etc.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

See an example PR here: https://github.com/google/site-kit-wp/pull/3324 (although worth creating a new branch because typos have been added in this branch)

Configure this file so that it

Only use en language dictionary

Test Coverage

No changes needed

Visual Regression Changes

N/A

QA Brief

Changelog entry

aaemnnosttv commented 3 years ago

@felixarntz check out https://github.com/marketplace/typo-ci

This would be great to add ahead of our upcoming work to add contributor docs.

aaemnnosttv commented 3 years ago

@felixarntz anything to add?

felixarntz commented 3 years ago

@aaemnnosttv No, all good from my perspective! 🚢

danielgent commented 3 years ago

Screenshot from 2021-05-06 11-08-25

Is the plan to set up a free trial and see how it goes? (from the description on the ticket I was not expecting a paid product :smile: )

aaemnnosttv commented 3 years ago

Is the plan to set up a free trial and see how it goes?

@danielgent nope! It's a free service for open source (the first option in the list there) 🙂

danielgent commented 3 years ago

I've created a PR with different kinds of typos if you want to see it in action https://github.com/google/site-kit-wp/pull/3324

Works really well

aaemnnosttv commented 3 years ago

Thanks @danielgent – IB looks good, just a few comments/suggestions:

matching patterns for source files that may contain user-facing strings

We don't need to list specific paths here but it would be nice to note/outline which file types or locations we should base the paths on .

We may also want to scaffold the excluded_words entry to the config, maybe with a googlesitekit in there – we should check to see if it flags this and the all-caps variant (we use both). Does it see all lower/upper the same? I would think it probably does but that would be good to know.

I was going to suggest we only run it for non-draft PRs but then I saw it only took 4 seconds to run, so I think it's fine 😄 Also, I think it only checks text in the diff rather than the entire code base which is what we'd want anyways.

Let's check on the case for any common things which might be flagged as misspellings which aren't in our codebase (like googlesitekit, GOOGLESITEKIT, tagmanager, webdatastreams, etc).

danielgent commented 3 years ago

Typo CI will be shut down soon https://mikerogers.io/2021/05/23/saying-goodbye-to-typo-ci

aaemnnosttv commented 3 years ago

Moving this to stalled for now.