Code review is a key practice in modern software development. Currently, this practice is performed using textual diff tools, such as the one provided by GitHub. However, diff results can easily become complex and hard to understand. Refactorings, for example, are not represented at all in diff results. This increases diff understanding because reviewers need to infer themselves that a given group of added and removed lines of code represent, for example, an extract method.
RAID is a tool pipeline that seamlessly enriches GitHub diff results with refactoring information. This pipeline has three key components:
- RefDiff: a tool to detect refactoring operations in commits. In our architecture, we rely on GitHub actions to automatically execute RefDiff after each Pull Request.
- An external server, that collects the list of refactorings produced by RefDiff.
- A Chrome plug-in that seamlessly annotates diff chunks associated to refactorings. As we described, the goal is to easily communicate to developers the reason behind the added/removed lines of code.
Source Code: https://github.com/rodrigo-brito/refactoring-aware-diff
INSTALLATION
- Install Refactoring-Aware Review Chrome Extension
- Include Refactoring-Aware Diff Action in GitHub CI (Available in Github description)
- Submit a new Pull Request to test the extension
An example of Pull Request with extracted refactorings can be viewed here: https://github.com/rodrigo-brito/refactoring-aware-diff/pull/5/commits
BUG REPORTS: https://github.com/rodrigo-brito/refactoring-aware-diff/issues
Extore is a team of professionals who are passionate about creating extensions for web browsers. This devotion also gives us opportunity to appreciate work of other people. We get inspired by useful, open source extensions made by developers all over the world. Our strong belief is that one should share helpful add-ons with others. That’s why we’d like to present you our ever-growing list of favourite extensions that have inspired us. Moreover, as you probably have already learned, sometimes struggling for the best brings an end to the good. Talking about add-ons it often turns out that an upgrade is worse then previous version. Also it can become really tricky to get back to the beloved version of your favourite extension. That’s why we’re going to make not only the latest, but all versions of our favourite (and we hope yours too) add-ons available for download. No more compromises, just stick to the version you really like!