On 06/22/2012 02:03 PM, David Nalley wrote:
On Fri, Jun 22, 2012 at 12:45 PM, David Nalley <da...@gnsa.us> wrote:
On Fri, Jun 22, 2012 at 12:37 PM, Wido den Hollander <w...@widodh.nl> wrote:
Hi,

While working on CloudStack I noticed that a lot of files still use tabs
instead of spaces.

I've been working on the agent mainly and there it seems bad.

The coding convention [0] says:

"Must indent with space not tabs. Indentation = 4 spaces"

Now, I'm sure this is legacy, but would anybody vote against fixing this?

A simple find + sed could fix a lot:

$ find -name '*.java' -exec sed -i --posix -e 's/\t/    /g' {} \;

I would want to try with the agent first and see how that works out, later
on we can fix other components like api, core and server.

Objections? Suggestions?

Wido

[0]:
http://docs.cloudstack.org/CloudStack_Documentation/Design_Documents/Coding_Conventions

A couple of comments - (and I don't know what infra's take on
pre-commit hooks is, they may be verboten)

Before this work started I'd like to see a pre-commit hook that
rejects commits with tabs, so that we stop the problem. (I also want
to see testing for line endings) Line endings and spaces are easy
places to start from a coding convention requirement phase, and we can
continue to build that up.

Aside from that, I'd love to see this done.

--David

OK, update - I talked with joes4 and danielsh in #asfinfra - and they
have a core set of hooks (for instance post-commit mail) and they are
worried about inefficiency, and claim that n number of hooks per
project is unsustainable/unmaintainable long term for hundreds of
repos, and that's a valid reasoning, so perhaps we need to make this a
jenkins job (and this looks like a great place to start our CI efforts
on ASF infrastructure).

We could have commit hooks and could depend on convention.

On another project I am involved with we have a hidden directory, .git-hooks, as part of the source tree. This directory contains the project's hook scripts. Contributors are expected to have a link from .git/hooks to .git-hooks such that the checks are run as expected.

Yes, these leaves the possibility for something to get missed, but as we do not have an incredible abundance of committers, and possibly should never get to that point, it appears reasonable to ask every committer to set up this link in the source tree they work with.

Later,
Robert



--
Robert Schweikert                           MAY THE SOURCE BE WITH YOU
SUSE-IBM Software Integration Center                   LINUX
Tech Lead
rjsch...@suse.com
rschw...@ca.ibm.com
781-464-8147


Reply via email to