This is a simple command-line tool that checks the spelling in a Git commit message using the apilayer Spellchecker API and automatically commits the changes if there are no spelling errors in the commit message. If there are spelling errors, it displays the mistakes and suggestions to the user.
Before using this tool, make sure you have the following prerequisites installed:
- Go programming language (https://golang.org/doc/install)
- Git (https://git-scm.com/downloads)
-
Clone this repository to your local machine:
-
Change into the project directory:
-
Build the Go executable:
-
Move the executable to a directory in your PATH (e.g., /usr/local/bin/):
To use this tool, follow these steps:
-
Ensure you are inside a Git repository where you want to enforce spelling checks for commit messages.
-
When you make a commit, use the ruth command followed by your commit message. For example:
- ruth fix buggs in the code
-
Replace "fix buggs in the code" with your actual commit message.
- The tool will check the spelling of your commit message using the apilayer Spellchecker API.
- If there are no spelling errors, it will automatically add and commit your changes
- If there are spelling errors, it will display the mistakes and suggestions for correction, and the commit will not be made. You can then edit your commit message accordingly.
You can configure the tool by modifying the following lines in the main function of the code:
-
url:This is the API endpoint for the apilayer Spellchecker API. You can replace it with your own endpoint if needed.
-
apikey: Replace the API key in the req.Header.Set("apikey", "your-api-key") line with your apilayer API key.
This project is licensed under the MIT License. See the LICENSE file for details.
Thanks to apilayer for providing the Spellchecker API used in this tool. This tool is inspired by the need to maintain consistent and error-free commit messages in Git repositories.