Hieu Nguyen

Internal design of Pronto

Mar 15 2017


Pronto is ruby library which helps you do code review on your changes very conveniently. It works with several linter, including rubocop, reek or brakeman. It’s not only output the issues in our terminal, but also putting comments PR, which reduces a lot of time for us to review styling and convention.

Recently, #hardcore group of Vietnamrb intents to create a similar tool for golang, and the first step for it is study how pronto works internally so that we can make a golang version of it.

Analyse

One of the most common command which we use is:

PRONTO_GITHUB_ACCESS_TOKEN=token pronto run -f github_pr -c origin/master
|                              | |        | |          | |              |
 ------------------------------   --------   ----------   --------------
            ||                      ||          ||              ||
            \/                      \/          \/              \/
        Access token           Main command    Formatter      Commit
     to use in Formatter     call Pronto::CLI

We’ll take this command apart and examinate each of them.

Dive into the Pronto.run

pronto run

How Pronto::Runners work, then?

Conclusion

  1. Linters which has good architecture that separates processing and output formatting, so that we can modify the output easily. I saw that there are golint, govet and metalinter which are very promising.
  2. Git client similar to rugged so that we can manipulate git repository to get all the patches and changes. Lib2git already published a git client similar to rugged in golang: git2go