From: Vladimír Vondruš Date: Mon, 31 Dec 2018 02:22:09 +0000 (+0100) Subject: doxygen: explicitly write trailing newline to all output files. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=93816321790c154099e1e9ea17689b5a9b0198bd;p=blog.git doxygen: explicitly write trailing newline to all output files. Makes test file updates much easier. I need to revisit this later with a more systematic solution. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 41bf411f..45c369a5 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -3324,6 +3324,11 @@ def run(doxyfile, templates=default_templates, wildcard=default_wildcard, index_ output = os.path.join(html_output, file) with open(output, 'wb') as f: f.write(rendered.encode('utf-8')) + # Add back a trailing newline so we don't need to bother + # with patching test files to include a trailing newline to + # make Git happy + # TODO could keep_trailing_newline fix this better? + f.write(b'\n') else: parsed = parse_xml(state, file) if not parsed: continue @@ -3337,6 +3342,11 @@ def run(doxyfile, templates=default_templates, wildcard=default_wildcard, index_ output = os.path.join(html_output, parsed.compound.url) with open(output, 'wb') as f: f.write(rendered.encode('utf-8')) + # Add back a trailing newline so we don't need to bother with + # patching test files to include a trailing newline to make Git + # happy + # TODO could keep_trailing_newline fix this better? + f.write(b'\n') # Empty index page in case no mainpage documentation was provided so # there's at least some entrypoint. Doxygen version is not set in this @@ -3355,6 +3365,11 @@ def run(doxyfile, templates=default_templates, wildcard=default_wildcard, index_ output = os.path.join(html_output, 'index.html') with open(output, 'wb') as f: f.write(rendered.encode('utf-8')) + # Add back a trailing newline so we don't need to bother with + # patching test files to include a trailing newline to make Git + # happy + # TODO could keep_trailing_newline fix this better? + f.write(b'\n') if not state.doxyfile['M_SEARCH_DISABLED']: data = build_search_data(state, add_lookahead_barriers=search_add_lookahead_barriers, merge_subtrees=search_merge_subtrees, merge_prefixes=search_merge_prefixes)