[PATCH] D69701: [Utils] Allow "on-the-fly" argument changes for update_test_check scripts

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 31 00:54:34 PST 2019


arichardson added inline comments.


================
Comment at: llvm/utils/update_test_checks.py:69
                       help='Remove attribute annotations (#0) from the end of check line')
+  parser.add_argument('--turn', choices=['on', 'off'], default='on',
+                      help='Initial state, check lines are upded only in "on" state')
----------------
I find the equals in the flag slightly confusing/non-intuitive.

Maybe better to add a action=store_true and a action=store_false booleanoption with the same `dest=`. Maybe --turn-on/--turn-off or simply --enable/--disable?


================
Comment at: llvm/utils/update_test_checks.py:172
+      args, argv = common.check_for_command(input_line, parser, args, argv)
+      if args.turn == 'off':
+          output_lines.append(input_line)
----------------
Use a bool argparse option?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69701





More information about the llvm-commits mailing list