typos-git-commit 0.1.6

This program analyzes a json file produced with `typos` and makes commits for each correction.
typos-git-commit-0.1.6 is not a library.
Visit the last successful build: typos-git-commit-0.5.2

Description

typos-git-commit is a command line tool that processes a typos generated json file to :

  1. correct typos in detected files (via sed)
  2. make a commit at each correction (via a simple git commit command)

It has been written for a one shot project but one may find it to be useful.

Usage

You can use the option --noop to print what will be executed. If you need to have a summary of all typos you can use --only-list-typos option. You can add some details to this summary with --details option. You can filter out what will be done using --exclude-file, -exclude-typo and -exclude-correction (options may be invoked more than once) to exclude a specific file, typo or correction from being taken into account.

  • Generate a json file with typos, for instance: typos doc/ --exclude *.py --exclude *.js --format json >typos.json
  • In the directory of the repository use typos-git-commit : typos-git-commit --filename typos.json. This command will correct only typos with more than 5 (by default) characters and the ones that got only one correction proposal. To modify the minimum length one may use --minlen or -m option.
  • Review carefully the generated commits even if everything is done to mitigate errors when replacing typos there are situations where this correction is really an error.
  • --message option allows to change your commit message. One may use the special notations {typo} and {correction} that will be replaced respectively by the typo to be corrected and the correction of that typo. Tip: use --noop to see how the git message will be before applying.

Changelog

  • v0.1.6

    • Adds --exclude-file, --exclude-typo, --exclude-correction, --debug options
    • Adds --print-not-corrected, -p option to also print what won't be corrected.
  • v0.1.5

    • Adds the ability to provide a different commit message.
    • --filename command line option is now mandatory
  • v0.1.4

    • Adds boundary word limits into sed's regex to avoid unwanted corrections.