Imhotep helps you enforce your styleguide during code review

Over the holiday break, I got a long-standing side project into a working state. Imhotep is a tool that will enforce coding standards on pull requests and commits. It accomplishes this by running code linters and commenting on your GitHub pull requests with any violations.

The main motivation for imhotep is based on a trend I saw at Google. We did pre-merge code reviews and I was on a team of approximately 12 people. It became apparent that different folks gave different sorts of code reviews. There were some people who would validate syntax, code style enforcement and rubber stamp your change. These were the tactical reviewers. There were others who would identify problematic aspects of your overall design and, as a result, would teach you a great deal about how to build robust software. These were the strategic reviewers.

Since leaving Google, I've aimed to generate more of the strategic code reviews and fewer of the syntax validation type, because strategic reviews offer the reviewee a chance to learn and offer the reviewer an opportunity for introspection. This introspection is helpful, because it helps me question why it is I feel a certain way. This aids when you need to articulate your design choices to your coworkers. That being said, keeping your code in good linting shape is still a worthwhile endeavor.

So I was an an impasse. Syntactic validation is useful, but low value to the reviewer. Coupled with the fact that it can be highly mechanical, this makes it a pretty great candidate for automation. This is why I've written imhotep. Imhotep is a python program you run, pointing it to a GitHub pull request. It will create PR comments with the output of the linters. If you do code review, give it a shot. It will help you and your team stay consistent regarding your code hygiene.

With this tool, you can get the best of both worlds: you can reserve your mental bandwidth for system design choices and defer the more mechanical validations to your linter.

If there's not a linter that your team uses, getting additional linters is easy. You can see those that are already written or file an issue for those you want. I'd love to have your feedback or contributions. I've already gotten some great contributions from fridgei and scottjab (Thanks!). Chris Dickinson was also kind enough to draw imhotep's logo and is looking for a few more to draw if you're interested.

© 2012 - 2023 · Home — Theme Simpleness