]> granicus.if.org Git - libvpx/commit
FTFY: an automated style corrector
authorJohn Koleszar <jkoleszar@google.com>
Tue, 27 Mar 2012 23:28:41 +0000 (16:28 -0700)
committerJohn Koleszar <jkoleszar@google.com>
Wed, 28 Mar 2012 21:05:56 +0000 (14:05 -0700)
commitcb265a497d05416572343b345a01ffa048aefda6
treec3f4ac54cf9c4777eb184512b2a0e789165e3622
parente9cacfd66df8f29055fb812681310bd27265eee0
FTFY: an automated style corrector

This is a utility for applying a limited amount of style correction on
a change-by-change basis. Rather than a big-bang reformatting, this
tool attempts to only correct the style in diff hunks that you touch.
This should make the cosmetic changes small enough that we can mix them
with functional changes without destroying the diffs, and there's an
escape hatch for separating the reformatting to a second commit for
purists and cases where it hurts readability.

At this time, the script requires a clean working tree, so run it after
you've commited your changes. Run without arguments, the style
corrections will be applied and left unstaged in your working copy. It
also supports the --amend option, which will automatically amend your
HEAD with the corrected style, and --commit, which will create a new
change dependent on your HEAD that contains only the whitespace changes.

There are a number of ways this could be applied in an automated manner
if this proves to be useful, either on a project-wide or per-user
basis. This doesn't buy anything in terms of real code quality, the
intent here would be to keep formatting nits out of review comments in
favor of more meaningful ones and help people whose habitual style
doesn't match the baseline.

Requires astyle[1] 1.24 or newer.
  [1]: http://astyle.sourceforge.net/

Change-Id: I2fb3434de8479655e9811f094029bb90e5d757e1
tools/ftfy.sh [new file with mode: 0755]
tools/intersect-diffs.py [new file with mode: 0755]