
5 Jun
2018
5 Jun
'18
2:56 a.m.
On Mon, Jun 4, 2018 at 9:49 PM Andy Shevchenko andriy.shevchenko@linux.intel.com wrote:
On Mon, 2018-06-04 at 21:27 +1200, Chris Packham wrote:
Moveconfig already attempts to remove empty #if/#endif blocks when there is a matching CONFIG_ being moved. Add a second pass which covers files without a match.
- pattern = r'^\s*#\s*if.*$\n^\s*#\s*endif.*$\n*'
Any reason not to use re.compile() ?
Laziness on my part. Will do in v2.
- with open(header_path) as f:
data = f.read()
- new_data = re.sub(pattern, '\n', data, flags=re.M)
-- Andy Shevchenko andriy.shevchenko@linux.intel.com Intel Finland Oy