Skip to content
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

ci: add typo checking #30

Merged
merged 1 commit into from
May 7, 2024

Conversation

storopoli
Copy link
Contributor

Since this is a public-facing documentation/resource repository,
we should be extra-careful and
judicious with typos.

typos is a powerful source code spell checker.

I've added a CI job that runs on every PR and push to master (but can also be run manually with workflow_dispatch) that checks for typos.

I've also added a config file .typos.toml that deals with false positives and ignore some vendor related files and some filetypes that we don't want to check/correct for typos,
e.g. lock files.

Finally, I've also corrected a few typos that were in the codebase that typos flagged.

If you want to run yourself you can do a cargo install (or binstall) the typos-cli:

cargo install typos-cli

It is also available in several pkg managers,
check the installation options at the typos repo

@storopoli
Copy link
Contributor Author

PS: If you find this useful, I can PR this across the rust-bitcoin crate ecosystem.

Cc @apoelstra.

.typos.toml Outdated Show resolved Hide resolved
@apoelstra
Copy link
Member

utACK 81bbee2.

I'm a bit confused about how this works and distinguishes between bech32/base64/base58/hex words and "real" words. But in general I think it's a good idea and we should have some sort of automatic typo checking. Would also be happy to have this elsewhere in the rust-bitcoin ecosystem.

@storopoli storopoli force-pushed the storopoli/ci/typos branch from 81bbee2 to 9cc833b Compare May 4, 2024 19:04
@storopoli storopoli requested a review from apoelstra May 4, 2024 19:05
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 9cc833b

Awesome, thanks!

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

This is sweet, thanks.

ACK 9cc833b

nit: There is a newline missing from the workflow. In case its interesting to you I have my editor configured to add a newline at end of file on save if its missing.

@storopoli storopoli force-pushed the storopoli/ci/typos branch from 9cc833b to ac5fc0e Compare May 5, 2024 10:23
@storopoli
Copy link
Contributor Author

nit: There is a newline missing from the workflow. In case its interesting to you I have my editor configured to add a newline at end of file on save if its missing.

Done!

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

utACK ac5fc0e

@tcharding
Copy link
Member

Needs rebase mate.

@storopoli storopoli force-pushed the storopoli/ci/typos branch 2 times, most recently from feb57cc to 0d2848a Compare May 6, 2024 08:01
@storopoli storopoli requested a review from tcharding May 6, 2024 08:02
@apoelstra
Copy link
Member

It looks like now there is a merge commit and an unsigned commit :). Can you try rebasing again.

@storopoli storopoli force-pushed the storopoli/ci/typos branch 3 times, most recently from ad9356d to 6ac14be Compare May 6, 2024 17:08
@storopoli storopoli requested a review from apoelstra May 6, 2024 17:11
@tcharding
Copy link
Member

Still not quite right :)

I pulled it down and had a look, I think you want to hard reset away the last patch and then rebase on master and fix the two conflicts. You should be left with a single patch.

@storopoli storopoli force-pushed the storopoli/ci/typos branch from 4197b67 to 6968fbf Compare May 7, 2024 10:20
@storopoli
Copy link
Contributor Author

Sorry, I was with a unsynced fork. Took me a while to figure out that this was the issue.
But I think it's ready now

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

utACK 6968fbf

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 6968fbf

@tcharding tcharding merged commit 1393055 into rust-bitcoin:master May 7, 2024
2 checks passed
@storopoli storopoli deleted the storopoli/ci/typos branch May 7, 2024 20:24
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