]> git.ipfire.org Git - people/ms/u-boot.git/commit
tools: moveconfig: trim garbage lines after header cleanups
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 25 Jul 2016 10:15:24 +0000 (19:15 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 5 Aug 2016 11:27:16 +0000 (07:27 -0400)
commit8ba1f5de4571566be12efaffdad404a506b978e3
treece6ac87b7a9d389e91de7ff0bdc388740e17b10b
parentf7536f798d99e77b543c7913dc45edbb77848078
tools: moveconfig: trim garbage lines after header cleanups

The tools/moveconfig.py has a feature to cleanup #define/#undef's
of moved config options, but I want this tool to do a better job.

For example, when we are moving CONFIG_FOO and its define is
surrounded by #ifdef ... #endif, like follows:

  #ifdef CONFIG_BAR
  #  define CONFIG_FOO
  #endif

The header cleanup will leave empty #ifdef ... #endif:

  #ifdef CONFIG_BAR
  #endif

Likewise, if a define line between two blank lines

  <blank line>
  #define CONFIG_FOO
  <blank lines.

... is deleted, the result of the clean-up will be successive empty
lines, which is a coding-style violation.

It is tedious to remove left-over garbage lines manually, so I want
the tool to take care of this.  The tool's job is still not perfect,
so we should check the output of the tool, but I hope our life will
be much easier with this patch.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
tools/moveconfig.py