Gofmt Tool for ReviewBot

Review Request #11265 — Created Nov. 5, 2020 and updated

jblazusi
ReviewBot
master
5d3c734...
reviewbot, students
ceciliawei, jace

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.

Loading file attachments...

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
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
Review request changed

Commit:

-2188643908c2f3186296f3638106bb665b73c00d
+5d3c73453bcf3c2923ad3c67c54118e90887769b

Diff:

Revision 2 (+54)

Show changes

Added Files:

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...