Conversation
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>
Roughly: https://github.com/check-spelling/spell-check-this/tree/976261d7b7184b67231c8668f2b35438496ca44f Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
1b8eab1 to
a12c271
Compare
| @@ -1,4 +1,5 @@ | |||
| emoji | |||
| esc'd | |||
There was a problem hiding this comment.
I'm still working on properly fixing it -- I've added some initial code to help with this and will write a test (but probably not today)
| @@ -0,0 +1,29 @@ | |||
| { | |||
There was a problem hiding this comment.
This file can contain configuration as long as it's delegated by $INPUTS via load-config-from.pr-base-keys.
| sudo apt-get update | ||
| sudo apt-get install -y cpanminus |
There was a problem hiding this comment.
- This is enables
actto run check-spelling per https://gitea.com/actions-oss/act-cli/issues/32#issuecomment-1075706
(DOCKER_HOST=unix:///Users/$USER/.rd/docker.sock act --container-daemon-socket - -j spelling 2>&1)
There was a problem hiding this comment.
Ah, they don't have the equivalent of DEBIAN_FRONTEND=noninteractive set (and whatever else that causes auto-detect to fall over)? Having that actually in the commit message would be nice, but that's sort of cherry on top here.
| git clone --branch "$version" --depth 1 "$repo" "$checkout" >&2 | ||
| git -c advice.detachedHead=false clone --branch "$version" --depth 1 "$repo" "$checkout" >&2 | ||
| else | ||
| git -C "$checkout" fetch origin "$version" >&2 | ||
| git -C "$checkout" checkout "$version" >&2 | ||
| git -c advice.detachedHead=false -C "$checkout" checkout "$version" >&2 |
There was a problem hiding this comment.
This reduces some noise at the start.
|
|
||
| INPUTS=$(yq --output-format=json <<EOF | ||
| suppress_push_for_open_pull_request: 1 | ||
| checkout: true |
There was a problem hiding this comment.
This isn't necessary as the workflow checks out the repository (or the repository exists because someone has it and is running this script).
There was a problem hiding this comment.
Yeah, I think I just copied it from the workflow without thinking too hard.
| cspell:dart/dart.txt | ||
| load-config-from: | | ||
| { | ||
| "pr-base-keys": [ |
There was a problem hiding this comment.
I'm not actually sure this is the right choice for this repository. I need to think about this a bit more... I think that the equivalent might actually be to use pr-trusted-keys.
The current code spelling.sh basically uses whatever is in this file which is effectively the merge head as opposed to the base...
Anyway, this change is more to talk about whether it would be desirable to use the JSON config which v0.0.26 has or rely on yq to produce json.
There was a problem hiding this comment.
Yeah, I think pr-trusted-keys makes more sense to us, because we don't allow any permissions in this workflow anyway so it should be no different; it just makes making PRs changing check-spelling configuration easier.
I don't think using the external JSON file is materially better (because we still need the bulk of the config in this file); if we can move all of it over there, then it would make more sense, instead of having configuration in two places instead. (Having just one line to load the other file, of course, is an exception.) Otherwise we already could have the whole thing in a different file, and only patch in use_sarif via jq/yq. Of course, if using the external file makes things much easier for version bumps, that's a good reason to do that; but in that case, please document why (in a GitHub PR comment is fine).
(P.S. the documentation needs an update now that v0.0.26 is out.)
| # 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 Cyrillic and Latin scripts, but if it isn't, you definitely want to correct this. | ||
| (?<=[A-Z]{2})[АВСЕНІӀЈКМОРЅТУ]|[АВСЕНІӀЈКМОРЅТУ](?=[A-Z]+(?:\b|[a-z]+)|[a-z]+(?:[^a-z]|$)) | ||
|
|
||
| # Homoglyph (Cyrillic) should be `a`/`b`/`c`/`e`/`o`/`p`/`x`/`y` | ||
| # It's possible that your content is intentionally mixing Cyrillic and Latin scripts, but if it isn't, you definitely want to correct this. | ||
| [авсеорху](?=[A-Za-z]{2,})|(?<=[A-Za-z]{2})[авсеорху]|(?<=[A-Za-z])[авсеорху](?=[A-Za-z]) | ||
|
|
There was a problem hiding this comment.
check-spelling will now complain about the presence of homoglyphs where letters should be if they substitute for a word in the dictionary.
If you're worried about individual homoglyphs, you'd still want this, in which case it'd make sense to pull in two more rules: https://github.com/check-spelling/spell-check-this/blob/6bdcf01505c96f16f6016cc97fd6a045baca8577/.github/actions/spelling/line_forbidden.patterns#L1006-L1010
There was a problem hiding this comment.
Yeah, we're not particularly worried about homoglyphs (more than typical). Saw that in the release notes, but didn't realize we already had something here. Thanks!
| # 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 Cyrillic and Latin scripts, but if it isn't, you definitely want to correct this. | ||
| (?<=[A-Z]{2})[АВСЕНІӀЈКМОРЅТУ]|[АВСЕНІӀЈКМОРЅТУ](?=[A-Z]+(?:\b|[a-z]+)|[a-z]+(?:[^a-z]|$)) | ||
|
|
||
| # Homoglyph (Cyrillic) should be `a`/`b`/`c`/`e`/`o`/`p`/`x`/`y` | ||
| # It's possible that your content is intentionally mixing Cyrillic and Latin scripts, but if it isn't, you definitely want to correct this. | ||
| [авсеорху](?=[A-Za-z]{2,})|(?<=[A-Za-z]{2})[авсеорху]|(?<=[A-Za-z])[авсеорху](?=[A-Za-z]) | ||
|
|
There was a problem hiding this comment.
Yeah, we're not particularly worried about homoglyphs (more than typical). Saw that in the release notes, but didn't realize we already had something here. Thanks!
| sudo apt-get update | ||
| sudo apt-get install -y cpanminus |
There was a problem hiding this comment.
Ah, they don't have the equivalent of DEBIAN_FRONTEND=noninteractive set (and whatever else that causes auto-detect to fall over)? Having that actually in the commit message would be nice, but that's sort of cherry on top here.
|
|
||
| INPUTS=$(yq --output-format=json <<EOF | ||
| suppress_push_for_open_pull_request: 1 | ||
| checkout: true |
There was a problem hiding this comment.
Yeah, I think I just copied it from the workflow without thinking too hard.
| cspell:dart/dart.txt | ||
| load-config-from: | | ||
| { | ||
| "pr-base-keys": [ |
There was a problem hiding this comment.
Yeah, I think pr-trusted-keys makes more sense to us, because we don't allow any permissions in this workflow anyway so it should be no different; it just makes making PRs changing check-spelling configuration easier.
I don't think using the external JSON file is materially better (because we still need the bulk of the config in this file); if we can move all of it over there, then it would make more sense, instead of having configuration in two places instead. (Having just one line to load the other file, of course, is an exception.) Otherwise we already could have the whole thing in a different file, and only patch in use_sarif via jq/yq. Of course, if using the external file makes things much easier for version bumps, that's a good reason to do that; but in that case, please document why (in a GitHub PR comment is fine).
(P.S. the documentation needs an update now that v0.0.26 is out.)
This takes advantage of a new feature in v0.0.26: config.json for defining configuration using json instead of in workflows.