juliehockett created this revision.
juliehockett added reviewers: aaron.ballman, hokein, alexfh.
juliehockett added a project: clang-tools-extra.
Herald added a subscriber: xazax.hun.

So that you can export the fixes generated.


https://reviews.llvm.org/D55848

Files:
  clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py


Index: clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
===================================================================
--- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
+++ clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
@@ -57,6 +57,9 @@
                       default='')
   parser.add_argument('-path', dest='build_path',
                       help='Path used to read a compile command database.')
+  parser.add_argument('-export-fixes', metavar='FILE', dest='export_fixes',
+                      help='Create a yaml file to store suggested fixes in, '
+                      'which can be applied with clang-apply-replacements.')
   parser.add_argument('-extra-arg', dest='extra_arg',
                       action='append', default=[],
                       help='Additional argument to append to the compiler '
@@ -122,6 +125,8 @@
   command.append('-line-filter=' + quote + line_filter_json + quote)
   if args.fix:
     command.append('-fix')
+  if args.export_fixes:
+    command.append('-export-fixes=' + args.export_fixes)
   if args.checks != '':
     command.append('-checks=' + quote + args.checks + quote)
   if args.quiet:


Index: clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
===================================================================
--- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
+++ clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
@@ -57,6 +57,9 @@
                       default='')
   parser.add_argument('-path', dest='build_path',
                       help='Path used to read a compile command database.')
+  parser.add_argument('-export-fixes', metavar='FILE', dest='export_fixes',
+                      help='Create a yaml file to store suggested fixes in, '
+                      'which can be applied with clang-apply-replacements.')
   parser.add_argument('-extra-arg', dest='extra_arg',
                       action='append', default=[],
                       help='Additional argument to append to the compiler '
@@ -122,6 +125,8 @@
   command.append('-line-filter=' + quote + line_filter_json + quote)
   if args.fix:
     command.append('-fix')
+  if args.export_fixes:
+    command.append('-export-fixes=' + args.export_fixes)
   if args.checks != '':
     command.append('-checks=' + quote + args.checks + quote)
   if args.quiet:
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to