Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pull Request Comment Syntax

Marvin Wyrich edited this page Jul 6, 2020 · 14 revisions

Q&A

What filehosting services are supported?

GitHub and GitLab are supported for now.

What kind of pull requests are supported?

Only open pull/merge requests will be scanned for comments.

What kind of comments are supported?

Comments pointing to a changed file are supported. It is important to place the comment at the specific line where you want the refactoring to be performed. You want to rename a method? Place the comment at the line where the method is declarated.

What refactoring operations are supported?

We currently support the following refactorings:

  1. Rename-Method
  2. Remove-Method-Parameter
  3. Add-Annotation-Override
  4. Reorder-Modifier

refactoring-bot-interaction-example

Comment Processing with ANTLR

We are using a refactoring specific language similar to SQL to process comments. Every comment needs to start with the tagged name of the bot user (the user who created the pull request, example: @Botname with Botname being the username of the bot account).

Example: Adding override annotation to a method declaration

BOT-Command: @Botname ADD ANNOTATION Override

Example: Reordering modifiers of a field declaration inside a file correctly

BOT-Command: @Botname REORDER MODIFIER

Example: Rename method

BOT-Command: @Botname RENAME METHOD TO y

y needs to be replaced by the new name of the method.

Example: Remove method parameter

BOT-Command: @Botname REMOVE PARAMETER y

y needs to be replaced by the parameter name of the parameter that should be deleted.