-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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] Introduce typos
pre-commit hook
#6564
Conversation
typos
pre-commit hooktypos
pre-commit hook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow nice! I went through all of these changes and agree with almost all of them. This caught a lot of issues, really nice!
I support adding this to the pre-commit
config. Let's see how it goes.
The only publicly-facing change is the renaming of
lgb.interprete()
tolgb.interpret()
in the R API. I'm unsure whether this change would be desired.
Yeah, please do revert these. I don't support breaking user code just to fix this typo. That function has been a part of the public API for several years.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much, happy to try this! Please just see 2 more small comments... I think maybe you forgot to push a commit.
I think we should mark |
Sorry, haven't noticed your comment from the first glance! WDYT about the following #6564 (comment)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviving this!
I'm happy to pick up the R changes in a later PR... can you please document that in an issue and assign it to me? It might be a while until I can prioritize it.
Left one more request... please revert the unrelated whitespace changes in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to try this, thanks!
While scrolling through the codebase, I noticed a few typos so I thought it would make sense to rectify them.
To do so, I added a new pre-commit hook, namely typos.
typos
is a spellchecker that minimizes the number of false positives by maintaining a list of known typos rather than a dictionary of known words.typos
can further be configured in the.typos.toml
file where false positives can be rectified, either by extending the list of "identifiers" or "words" that are actually not typos as maintained by thetypos
tool (loosely speaking, an "identifier" is anything that would be a valid variable name in e.g. Python while a "word" are the individual parts of camel-cased/snake-cased/... names). For instances where the notion of "identifiers" and "words" is insufficient (e.g. for URLs with apparent typos), a list of regexes of strings to ignore can be added.Apart from the changes to
.pre-commit-config.yaml
and the creation of.typos.toml
, the changes in this PR merely fix the typos uncovered by thetypos
pre-commit hook.The only publicly-facing change is the renaming of
lgb.interprete
tolgb.interpret
in the R API. I'm unsure whether this change would be desired.