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

Fix typos #7241

Merged
merged 2 commits into from
Jan 9, 2024
Merged

Fix typos #7241

merged 2 commits into from
Jan 9, 2024

Conversation

szepeviktor
Copy link
Contributor

Found new misspellings.

typos is a better tool than the current spell checker.

@szepeviktor szepeviktor requested a review from a team as a code owner January 5, 2024 22:33
@szepeviktor szepeviktor changed the title Typos Fix typos Jan 5, 2024
@szepeviktor
Copy link
Contributor Author

szepeviktor commented Jan 5, 2024

For anyone interested in .typos.toml

[files]
extend-exclude = [
    ".git/",
    ".codespell.ignore.txt",
    "go.mod",
    "go.sum",
    "vendor/",
]
ignore-hidden = false

[default]
extend-ignore-re = [
    # PEM
    "\\b[+/0-9=A-Za-z]{64}\\b",
    ' := `\{"[0-9A-Z_a-z-]{36,}"\}`',
    '"(csr|d|dp|n|protected|qi|signature|y)": ?"[0-9=A-Z_a-z-]{36,}"',
    'bigIntFromB64\("[0-9=A-Z_a-z-]{36,}"\)',
    "0002a4ba3cf408927759",
    "65CuDAA",
    '"sql_warnings", "TrUe"',
    '"tx_read_only", "FalSe"',
    "evenMOREcaps",
    '"iSsUe"',
]

[default.extend-words]
# Extended DNS Error
"ede" = "ede"
# Alternative spelling
"unmarshaling" = "unmarshaling"

[default.extend-identifiers]
"caaFailer" = "caaFailer"
"challStrat" = "challStrat"
"ExpectedStratType" = "ExpectedStratType"
"otConf" = "otConf"
"serInt" = "serInt"
"StratName" = "StratName"
"UPDATEs" = "UPDATEs"
"vai" = "vai"

@pgporada
Copy link
Member

pgporada commented Jan 8, 2024

Thanks! We currently use misspell via .golangci.yml and codespell. Would you like to file an additional PR to implement typos?

@pgporada pgporada requested a review from a team January 8, 2024 16:35
@szepeviktor
Copy link
Contributor Author

You're welcome.

I could replace codespell with typos.
Is it okay for you?

@szepeviktor
Copy link
Contributor Author

But typos is a single Go binary, not a Python package

@pgporada
Copy link
Member

pgporada commented Jan 8, 2024

That seems alright, let's give it a shot.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Jan 8, 2024

Sorry. I was wrong.
typos is written in Rust.
https://github.com/crate-ci/typos

I know how to download it locally, and how to use it in GitHub Actions.
uses: crate-ci/typos@v1.17.0

Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

Thanks for catching these typos! As far as I can tell, the rust "typos" crate behaves very differently from codespell -- rather than having a dictionary of known words and triggering on anything it doesn't recognize, it has a dictionary of known typos and triggers on seeing those. So it has low false positives, but potentially high false negatives. I'd be happy to accept a PR which runs it alongside codespell; I think we'd want to talk a bit more about using it to wholly replace codespell.

@aarongable
Copy link
Contributor

@szepeviktor We discussed this today, and we'd be happy to replace codespell with typos! Removing python from our toolchain is good. I'm going to merge this change now so we get these benefits immediately, but if you'd like to prepare another PR that removes codespell and replaces it with pre-built typos binaries (we will need a binary for arm64, too) then we'd love to accept that contribution too. Thanks!

@aarongable aarongable merged commit 5c0ca04 into letsencrypt:main Jan 9, 2024
18 checks passed
@szepeviktor szepeviktor deleted the typos branch January 9, 2024 21:20
@szepeviktor
Copy link
Contributor Author

All right.
Is test.sh the only place I have to operate?

boulder/test.sh

Line 222 in 5c0ca04

run_and_expect_silence codespell \

@aarongable
Copy link
Contributor

No, the only reason test.sh is able to directly call codespell like that is because test.sh runs inside our testing docker container, which installs codespell as part of the container creation process. You'll want to remove that, and probably want to add steps that install typos to the same container image inside build.sh or in the dockerfile directly.

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.

None yet

3 participants