lucenenet icon indicating copy to clipboard operation
lucenenet copied to clipboard

Add pre-commit with codespell hook

Open jbampton opened this issue 2 months ago • 2 comments

  • [X] You've read the Contributor Guide and Code of Conduct.
  • [ ] You've included unit or integration tests for your change, where applicable.
  • [ ] You've included inline docs for your change, where applicable.
  • [X] There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Summary of the changes (Less than 80 chars)

Fixes #{issue number} (in this specific format)

Description

refs #1213

Added codespell with pre-commit to run with GitHub actions.

Added a default ignored words list codespell.txt. This file can be cleaned up later as we fix the spelling in the code base.

Example on Apache Sedona:

https://github.com/apache/sedona/blob/194d4536f69c48c3e241d3f47a676a1a2fc70686/.github/workflows/pre-commit.yml

Official example:

https://pre-commit.com/#github-actions-example

jbampton avatar Nov 05 '25 12:11 jbampton

Can we set up an exclude list for specific files or folders?

One thing to be weary of is the fact that we copied all of our test data from Lucene and it should remain unchanged. For example, the .txt and .xml files here: https://github.com/apache/lucenenet/tree/master/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound

But it may be simpler if we just exclude every folder that starts with Lucene.Net.Tests (or is an exact match) from this tool, since spelling mistakes in test strings may also be intentional.

NightOwl888 avatar Nov 05 '25 13:11 NightOwl888

Yes we can exclude files and folders. I will add the exclude now for Lucene.Net.Tests

jbampton avatar Nov 05 '25 13:11 jbampton