[PATCH] D56343: [clang-tidy] Refactor: Compose Method on check_clang_tidy.py

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 7 01:51:53 PST 2019


serge-sans-paille added inline comments.


================
Comment at: test/clang-tidy/check_clang_tidy.py:103
 
+  return (has_check_fixes, has_check_messages, has_check_notes, \
+    check_fixes_prefixes, check_messages_prefixes, check_notes_prefixes)
----------------
Such a long list of returned values make me wonder if it would be worth creating a NamedTuple / class to hold them.
This may make the call site more readable too.


================
Comment at: test/clang-tidy/check_clang_tidy.py:141
+           '-check-prefixes=' + ','.join(check_notes_prefixes),
+           '-implicit-check-not={{note|warning|error}}:'])
+  return
----------------
These three `check_*` function all use the same `'FileCheck', '-....']` pattern. Maybe it's worth syndicating that to a try_run_filecheck(input_file0, input_file1, *extra_args)` function.


================
Comment at: test/clang-tidy/check_clang_tidy.py:178
+    check_fixes_prefixes, check_messages_prefixes, check_notes_prefixes = \
+    get_prefixes(args.check_suffix, input_text)
+
----------------
This is the verbose call site I was pointing to above.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56343/new/

https://reviews.llvm.org/D56343





More information about the cfe-commits mailing list