incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <>
Subject Code Prettifiers
Date Mon, 27 Aug 2012 14:33:04 GMT
>From the threads in the past on this subject, it seems like:

-Style is an opinion, but:
-A consistent style would be nice even if it's not everyone's preference
-We don't want to shy away contributors by annoying them with style concerns

I think we could get some value out of using a command-line code prettifier
and shared git hooks. The flow I'm envisioning here is:

$ git commit ...
// git hooks complain about your style and tell you to run fix_style
$ bin/fix_style
$ git diff // Shows you what the reformatter did to you.
$ git add ...
$ git commit // passes the style check.

1. We should never have to complain about style when looking at pull
2. We should get a consistent style
3. In the least, I'd like to see consistent tabs v spaces & no trailing ws.

One thing we may have to do is ask a contributor to enable the git hooks.
AFAIK there is no way to enable shared git hooks for a project by default,
so what we'd have is a directory called "hooks" and you'd need to create a
symlink for it into your .git/ directory.

If no one objects, then I'll pursue this today/tomorrow. My plan is to
start with whitespace (sed or awk), get that working, and then see what
x-platform open-source formatters exist out there.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message