[ci] Introduce `typos` pre-commit hook
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 the typos 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 the typos pre-commit hook.
The only publicly-facing change is the renaming of lgb.interprete to lgb.interpret in the R API. I'm unsure whether this change would be desired.
The only publicly-facing change is the renaming of lgb.interprete to lgb.interpret in the R API. I'm unsure whether this change would be desired.
I think we should mark lgb.interprete as deprecated and remove it in a next release.
Under the hood lgb.interprete should call lgb.interpret for now.
@jameslamb
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.
Sorry, haven't noticed your comment from the first glance!
WDYT about the following https://github.com/microsoft/LightGBM/pull/6564#issuecomment-2248143004?