- only complain about duplicate 'sources' lines if they contain
more than 1 elements each (before, 0 and 1 element lists were
counted too). In practice, this only has an effect for
clang/lib/Headers/BUILD.gn
- make the '# NOSORT' diag actually work. This too only affects
clang/lib/Headers/BUILD.gn.
In aggregate, changes to clang/lib/Headers/BUILD.gn still can't
be auto-merged, but for a slighly better reason.
with open(gn_file) as f:
gn_contents = f.read()
- srcs_tok = 'sources = ['
+ srcs_tok = 'sources = [\n'
tokloc = gn_contents.find(srcs_tok)
if tokloc == -1: raise ValueError(gn_file + ': Failed to find source list')
if gn_contents.find(srcs_tok, tokloc + 1) != -1:
raise ValueError(gn_file + ': Multiple source lists')
- if gn_file.find('# NOSORT', 0, tokloc) != -1:
+ if gn_contents.find('# NOSORT', 0, tokloc) != -1:
raise ValueError(gn_file + ': Found # NOSORT, needs manual merge')
tokloc += len(srcs_tok)