[PYTHON] A bot that automatically detects typos hidden in Pull Request and acts as a correction

Review of Pull Request! It's a shame that the moment I challenged, I got the first punch, "Here's a typo." Also, this is a burden to the person who points out, and it is a daunting task.

Humans should focus on checks that only humans can do, and it's a waste to spend valuable review time correcting typographical errors. Therefore, we developed a bot that automatically detects and corrects typos. Its name is ** typot **.

chakki-works/typot image.png

This was released with the recently announced GitHub Marketplace. I'm creating it in a new form of GitHub app, GitHub Apps (https://developer.github.com/apps/) (previously it was a webhook or OAuth). GitHub Apps is not a user like OAuth, but a repository. Therefore, it is possible to prevent the situation where the application cannot be used because the administrator user disappears (or the authority is lost). I have gained a lot of knowledge about this area + development method, so I have published it in a separate article (http://qiita.com/icoxfog417/items/fe411b94b8e7ae229e3e). Anyway, in short, if you want to use it, you can install it only in the target repository.

Feature

Seeing is believing, so see how ** typot ** actually works.

typot.gif

You can see this point from the operation demo.

How it works

** typot ** will check the typo when a pull request is opened in the installed repository (* Currently only supports English, check [PyEnchant]( (http://pythonhosted.org/pyenchant/) is used). If a typo is found, it will be pointed out as a review comment along with correction candidates.

typo_comment.png

Then, if there is an appropriate modification candidate, just select it and the file will be modified automatically.

typo_fix1.png typo_fix2.png

Now the typo check is automated and you don't have to worry about fixing it. All of these operations are implemented in the GitHub API. In that sense, I wonder if you can see the richness of GitHub's API.

Currently, I only check typos, but since my team is engaged in natural language processing / machine learning, I would like to be able to do more advanced checks that lighten the review load of people (team's). For more information on our activities, please read the Team Blog).

We hope you find it useful for your review! (If you give me a Star, it's worth making m (_ _) m)

chakki-works/typot

Recommended Posts

A bot that automatically detects typos hidden in Pull Request and acts as a correction
A Python script that reads a SQL file, executes BigQuery and saves the csv
A bot that automatically detects typos hidden in Pull Request and acts as a correction
A script that combines your favorite python modules and binaries into one Lambda Layer
[Python] I made a LINE Bot that detects faces and performs mosaic processing.
Automatically access the flow in enebular and pull the trigger