Coding Phase 2 - Part 1

GSoC 2019 with coala

Posted by Akshat on July 12, 2019

I spent the whole day removing a component which I shouldn’t have been doing, so left annoyed I thought might as well write the blog, so here I am.

Progress till now

In Phase 1, I sucessfully completed providing support for bears to define their actions and also implemented two actions for GitCommitBear: AddNewlineAction and EditCommitMessageAction. Here’s a little demo of them in action (pun not intended).

Beware, clicking on this will redirect you. I couldn’t figure out how to play it here itself. If you know how to do it, tell me. what

While working on this I came across an interesting bug in color_letter function in ConsoleInteraction module. This function basically beautifies action names when they get printed on screen. The interesting thing about this was its implementation choice and the fact that no one caught this bug before. Explaining this bug will take a lot of time, if interested have a look here.

After this I also wrote a tutorial which will help write bear specific actions.

What’s next?

I have been working on next part of the project which is providing support for bears to suggest multiple patches. For this I have added a new attribute to Result class, alternated_diffs. It is a list of dictionary, where each element is a alternate patch. And for each of these alternate patch an instance of AlternatePatchAction is added. This solution is a little hackish but it works, and I don’t think there is any other way to do this without making huge changes to the core which is not worth it. I still have to test this and make some minor changes, and I also need content to write for the second blog so see you there.