Gofmt Tool for Review Bot

Review Request #11265 — Created Nov. 4, 2020 and submitted

jblazusi
ReviewBot
master
d9025b0...
reviewbot, students
ceciliawei

The tool is designed to be a lightweight solution capable of checking
whether a file is correctly formatted or not based on go fmt output.
Unfortunately, other go commands such as go vet are better suited to
inherit from the RepositoryTool, as they require the ability to check
entire packages to properly test and vet files.

Manual testing was done to confirm that go fmt is working correctly.


Description From Last Updated

This is the user-visible name, so let's use name = 'go fmt'

daviddavid

This is short enough that we can fit it all on one line: gofmt_output = execute(['go', 'fmt', path])

daviddavid

If you add rich_text=True to this function call, it should format the go fmt as a code block.

daviddavid

I don't think we need the empty line here?

ceciliaweiceciliawei
jblazusi
david
  1. 
      
  2. bot/reviewbot/tools/gofmt.py (Diff revision 1)
     
     

    This is the user-visible name, so let's use name = 'go fmt'

  3. bot/reviewbot/tools/gofmt.py (Diff revision 1)
     
     
     
     
     
     
     

    This is short enough that we can fit it all on one line:

    gofmt_output = execute(['go', 'fmt', path])
    
  4. bot/reviewbot/tools/gofmt.py (Diff revision 1)
     
     
     

    If you add rich_text=True to this function call, it should format the go fmt as a code block.

    1. Fantastic, I was wondering why it was not presenting it in a code block. Thank you.

  5. 
      
jblazusi
david
  1. Ship It!
  2. 
      
jblazusi
  1. 
      
  2. 
      
jblazusi
ceciliawei
  1. 
      
  2. bot/reviewbot/tools/gofmt.py (Diff revision 3)
     
     

    I don't think we need the empty line here?

    1. Yes, that is correct.

  3. 
      
jblazusi
jblazusi
david
  1. Ship It!
  2. 
      
jblazusi
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (4e36e75)
Loading...