Inspiration

Starting to work on a larger project is often intimidating. We developed this powerful tool to make it easier for programmers to get familiar with a new project.

What it does

Disastrous bugs could often be avoided, if a programmer would understand the codebase better. The best way to understand somebody else's code is to talk directly to the author. But in huge projects it is very hard to find out who wrote a specific component. This tool makes it extremely easy for everyone to find out who wrote a specific part of the source code. "Codeowners" returns a list of authors ranked by how often he changed the component. We started by identifying what distinct components we would need for a complete implementation of our vision. In order to make this large project feasible in such a short timeframe, we decided to limit our efforts during the weekend to implementing the command line interface that would form the backbone to our components hierarchy. We then developed an algorithm that identifies the code-owners for a given file and declaration in the context of the Git version control system. Then we further divided the algorithm into all the functions that we're necessary to implement. On Saturday morning we already had a first working implementation. We then spent some time looking into how we could implement an IntelliJ plugin that would make our project readily available from an IDE, but then decided to spent the remaining time to further polish and expand the application domain of our CLI backbone.

Throughout our development process, we put a huge focus on extensibility. Our Codeowners project is now extensible on multiple levels:

  • It is built on tree-sitter parsers, thus it is incredibly easy to add support for new languages.
  • It provides a CLI that was purposefully crafted to work well as a data-source to applications built on top and to also be nice to interact with directly.

Challenges we ran into

  • Initially, we decided to implement our CLI program in Python, but after messing around with relative imports for a while we quickly moved-on to Node tech stack. We compile our TypeScript source with Babel to standard ES5 JavaScript.
  • Due to a bug, we had some trouble to write a general purpose solution for traversing abstract syntax trees with the goal of finding a declarations given line numbers and vice versa. We were able to figure it out in the end.

What's next for Who Wrote That S**t

  • plugins for various code editors (e. g. IntelliJ)
  • support for all languages parseable by tree-sitter

Built With

Share this project:

Updates