[PATCH] D31326: Add option to export fixes to run-clang-tidy.py
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 7 06:47:29 PDT 2017
alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.
A few more nits.
================
Comment at: run-clang-tidy.py:93
+def merge_replacement_files(tmpdir, fixfile):
+ """Merge all replacement files in a directory into a single fixfile"""
+ # MainSourceFile: The key is required by the definition inside
----------------
I'm not sure "fixfile" is a word. Just "file" maybe?
================
Comment at: run-clang-tidy.py:96
+ # include/clang/Tooling/ReplacementsYaml.h, but the value
+ # is actually never usid inside clang-apply-replacements,
+ # so we set it to '' here.
----------------
nit: "usid"
================
Comment at: run-clang-tidy.py:100
+
+ for replacefile in glob.iglob(tmpdir + '/*.yaml'):
+ with open(replacefile, 'r') as f:
----------------
I'd use `os.path.join()` instead of concatenation.
================
Comment at: run-clang-tidy.py:104
+ if not content:
+ continue # Skip empty files
+
----------------
nit: Add a trailing period.
================
Comment at: run-clang-tidy.py:109
+ except KeyError:
+ pass # Ignore files with missing keys
+
----------------
nit: Add a trailing period.
https://reviews.llvm.org/D31326
More information about the cfe-commits
mailing list