Skip to content

Conversation

@joncinque
Copy link
Contributor

@joncinque joncinque commented Nov 21, 2024

Problem

There are often typos in code or READMEs, but they don't get caught.

Summary of changes

Integrate cargo spellcheck to automate spellchecking all Rust code in the repo.

I wasn't sure where to put the additional configuration, so I hope scripts was an ok destination.

#### Problem

There are often typos in code or READMEs, but they don't get caught.

#### Summary of changes

Integrate `cargo spellcheck` to automate spellchecking all Rust code in
the repo.

I wasn't sure where to put the additional configuration, so I hope
`scripts` was an ok destination.
@joncinque joncinque marked this pull request as ready for review November 21, 2024 22:31
@joncinque joncinque requested review from febo and lorisleiva November 21, 2024 22:31
lorisleiva
lorisleiva previously approved these changes Nov 22, 2024
Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

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

Thanks! Just a few nits.

Comment on lines 71 to 79
- name: Install cargo-spellcheck
uses: taiki-e/install-action@v2
with:
tool: cargo-spellcheck

- name: Setup Environment
uses: ./.github/actions/setup
with:
cargo-cache-key: cargo-spellcheck
Copy link
Member

Choose a reason for hiding this comment

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

nit: as a convention, the other jobs are using the setup action immediately after the git checkout step. Could we do the same here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, good call, I misunderstood how the cache action works, thanks!

package.json Outdated
"clients:rust:test": "zx ./scripts/client/test-rust.mjs",
"template:upgrade": "zx ./scripts/upgrade-template.mjs"
"template:upgrade": "zx ./scripts/upgrade-template.mjs",
"spellcheck:rust": "cargo spellcheck --code 1"
Copy link
Member

Choose a reason for hiding this comment

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

Should we call this rust:spellcheck in preparation for febo's work on unifying scripts?

@febo After your refactoring, I think this should be part of the lint subtasks, so it would probably need to be located in scripts/rust/lint-spellcheck. Lmk what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!

Copy link
Contributor

@febo febo left a comment

Choose a reason for hiding this comment

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

Looks great!

@joncinque joncinque merged commit 3d60133 into solana-program:main Nov 22, 2024
10 checks passed
@joncinque joncinque deleted the spellcheck branch November 22, 2024 12:15
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