rewritemeta: fix proper_format() so lint works with .yml files

This commit is contained in:
Hans-Christoph Steiner 2018-02-23 22:42:46 +01:00
parent 5a6a51a29e
commit 0fa50ebcb2

View file

@ -36,7 +36,11 @@ def proper_format(app):
# read in metadata.py # read in metadata.py
with open(app.metadatapath, 'r', encoding='utf8') as f: with open(app.metadatapath, 'r', encoding='utf8') as f:
cur_content = f.read() cur_content = f.read()
metadata.write_txt(s, app) _ignored, extension = common.get_extension(app.metadatapath)
if extension == 'yml':
metadata.write_yaml(s, app)
elif extension == 'txt':
metadata.write_txt(s, app)
content = s.getvalue() content = s.getvalue()
s.close() s.close()
return content == cur_content return content == cur_content