X Tutup
Skip to content

Spell check#2457

Closed
jsoref wants to merge 12 commits intocli:trunkfrom
jsoref:spell-check
Closed

Spell check#2457
jsoref wants to merge 12 commits intocli:trunkfrom
jsoref:spell-check

Conversation

@jsoref
Copy link
Copy Markdown
Contributor

@jsoref jsoref commented Nov 22, 2020

closes #2442

@mislav mislav mentioned this pull request Nov 23, 2020
Copy link
Copy Markdown
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Thank you! The fixes look good, so I've merged them separately from your PR. Adding a spell checker as an Action, however, warrants some discussion first.

- "**"
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '15 * * * *'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How would this workflow benefit from being scheduled in addition to running on push?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Push only works if people enable actions in their forks. For security reasons, this isn't a GitHub default.

The normal approach would be to use the pull_request event, but that event doesn't have comment permissions.

There's a newer event, but I can't recall if I've tested it, and the released action doesn't support that.

- uses: actions/checkout@v2.0.0
with:
fetch-depth: 5
- uses: check-spelling/check-spelling@0.0.16-alpha
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we want to add such as early-phase Action as a dependency to our project. Furthermore, I do not think that this warrants being its own workflow, since we already have a lint workflow.

Ideally, a spell checker for our Go source code would be added through our linters. Currently, we use golangci-lint as a linter, and there exists a "misspell" linter that we could enable. Unfortunately, it looks like it only catches misspellings in code comments or strings, but not identifiers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

microsoft/terminal, microsoft/PowerToys, microsoft/winget-cli to name a few repos that rely upon this action. They all like it except when they realize that their spelling is not great 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not attached to how you anchor/use this action. I'm applying it by using a template. You should be able to place it elsewhere as fits your workflow.

If you run into problems, I'm happy to try to address them in the action.

@jsoref
Copy link
Copy Markdown
Contributor Author

jsoref commented Nov 23, 2020

Thanks for merging the spelling fixes. One note on this PR: if you choose to take it, you'll want to ensure that the trunk branch is happy, otherwise people who fork from the unhappy point will be confused & unhappy as the action will complain about the pre-existing typos. Also note that the action's schedule will actually check pulls that don't yet have the action (it uses itself as a baseline if the branch is missing the checker).

@mislav
Copy link
Copy Markdown
Contributor

mislav commented Nov 23, 2020

@jsoref @alannt777 Thanks for the additional context!

After some more deliberation and looking at the implementation of check-spelling, I've decided that this Action is not the approach we want to take with guarding ourselves from spelling errors. Future spelling errors potentially happening in our project is a risk tolerable to this project.

I would be open to adding a linter for misspelled Go identifiers, but it doesn't look like such a linter is readily available.

@mislav mislav closed this Nov 23, 2020
@jsoref jsoref deleted the spell-check branch October 4, 2022 02:09
@jsoref jsoref restored the spell-check branch October 4, 2022 02:11
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.

[GitHub Actions] Use GitHub Actions for spell checking

2 participants

X Tutup