Add pre-commit with codespell and fix typos#917
Conversation
The codespell hook is self contained and is bootstrapped with pre-commit. There is no need to have codespell installed to run pre-commit. To recreate the codespell ignored words list - codespell.txt - you will need to have codespell installed locally. Ran locally: `codespell --skip='./api/src/main/resources/jakarta/faces' | cut -f2 -d' ' | tr A-Z a-z | sort | uniq > .github/linters/codespell.txt` https://github.com/pre-commit/pre-commit https://pre-commit.com/ https://github.com/codespell-project/codespell https://pre-commit.com/#github-actions-example pre-commit config examples: https://github.com/apache/sedona/blob/master/.pre-commit-config.yaml https://github.com/apache/airflow/blob/main/.pre-commit-config.yaml There are many more hooks we could add for example: https://github.com/pre-commit/pre-commit-hooks
|
@jbampton @melloware I'm a bit busy and won't have time until next week |
|
@bohmber no rush...I didn't want to merge a pre-commit hook PR without someone like you verifying and approving it. |
| path: ~/.cache/pre-commit | ||
| key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
| - name: Run pre-commit | ||
| run: pre-commit run --all-files |
There was a problem hiding this comment.
I'm sorry for not looking at this sooner!
I see that it mentions --all-files here. Does this mean all files in the project or only those in the pull request? Can it be just the latter?
| abl | ||
| activater | ||
| afterall | ||
| agains | ||
| als | ||
| ans | ||
| bais | ||
| bu | ||
| cacheing | ||
| checkin | ||
| childs | ||
| compliancy | ||
| curren | ||
| deleteable | ||
| feeded | ||
| fo | ||
| implementor | ||
| implementors | ||
| ist | ||
| mot | ||
| nd | ||
| noe | ||
| notin | ||
| ois | ||
| optiona | ||
| ore | ||
| ot | ||
| overriden | ||
| precence | ||
| resetable | ||
| reseted | ||
| re-use | ||
| seperator | ||
| sie | ||
| slashs | ||
| speakin | ||
| splited | ||
| splitted | ||
| vew | ||
| vie |
There was a problem hiding this comment.
Some of these are from the "./api/src/client" directory. Can we ignore that location too?
There was a problem hiding this comment.
yes please ignore it, this is a directory which is regularily partially overwritten by an incoming npm package from my doenstream project!
|
This looks good based on my investigation. I don't have many objects -- just that one comment. @bohmber @tandraschko Your thoughts? |
|
@jbampton Just following up. |
The codespell hook is self contained and is bootstrapped with pre-commit. There is no need to have codespell installed to run pre-commit.
To recreate the codespell ignored words list - codespell.txt - you will need to have codespell installed locally.
Ran locally:
codespell --skip='./api/src/main/resources/jakarta/faces' | cut -f2 -d' ' | tr A-Z a-z | sort | uniq > .github/linters/codespell.txthttps://github.com/pre-commit/pre-commit
https://pre-commit.com/
https://github.com/codespell-project/codespell
https://pre-commit.com/#github-actions-example
pre-commit config examples:
https://github.com/apache/sedona/blob/master/.pre-commit-config.yaml
https://github.com/apache/airflow/blob/main/.pre-commit-config.yaml
There are many more hooks we could add for example:
https://github.com/pre-commit/pre-commit-hooks