You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by John Sanda <js...@redhat.com> on 2017/10/28 03:29:30 UTC

code style guidelines

I just submitted a very small PR[1] for a CLI issue, and I see that the
travis build failed due to formatting. I am using emacs, and it is
configured to run gofmt on save. I really have not done much Go programming
so I was a bit surprised to learn that gofmt uses tabs instead of spaces.
Are there style guidelines or conventions documented anywhere? I want to
make sure that I follow whatever conventions are in place.

[1] https://github.com/apache/incubator-openwhisk/pull/2909

Re: code style guidelines

Posted by Carlos Santana <cs...@gmail.com>.
Hi John thanks for the PR
You can setup the scancode utility that we use as a pre-commit hook here
https://github.com/apache/incubator-openwhisk/wiki/Contributing:-Git-guidelines

It checks for license headers also
The repo is here
https://github.com/apache/incubator-openwhisk-utilities/tree/master/scancode

We use spaces and other minor code styles as describe in the scancode repo
These include:
has_block_license
no_tabs
no_trailing_spaces
eol_at_eof


On Fri, Oct 27, 2017 at 11:29 PM John Sanda <js...@redhat.com> wrote:

> I just submitted a very small PR[1] for a CLI issue, and I see that the
> travis build failed due to formatting. I am using emacs, and it is
> configured to run gofmt on save. I really have not done much Go programming
> so I was a bit surprised to learn that gofmt uses tabs instead of spaces.
> Are there style guidelines or conventions documented anywhere? I want to
> make sure that I follow whatever conventions are in place.
>
> [1] https://github.com/apache/incubator-openwhisk/pull/2909
>