[PATCH] D140217: [lit] Script to automate use of %(line-n). Use in CodeComplete tests.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 01:14:55 PST 2022


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

Thanks! The change looks good to me (I assume our internal lit support part is completed). (I think we can do a cleanup in `clang/test/Index` as well).



================
Comment at: llvm/utils/relative_lines.py:17
+
+USAGE = """Example usage:
+    find clang/test/CodeCompletion | grep -v /Inputs/ | \
----------------
This variable is not used in anywhere, and not print out in `--help` mode. I think it is more useful to move it to the above file comment, at least it is shown in `--help` mode.


================
Comment at: llvm/utils/relative_lines.py:18
+USAGE = """Example usage:
+    find clang/test/CodeCompletion | grep -v /Inputs/ | \
+    xargs relative_lines.py --dry-run --verbose --near=100 \
----------------
nit: find command is missing `-type f`.


================
Comment at: llvm/utils/relative_lines.py:20
+    xargs relative_lines.py --dry-run --verbose --near=100 \
+    --pattern='-code-completion-at[ =]%s:(\\d+)' \
+    --pattern='requires fix-it: {(\d+):\d+-(\d+):\d+}'
----------------
`\\d` should be `\d`?


================
Comment at: llvm/utils/relative_lines.py:31
+                                 formatter_class=argparse.RawTextHelpFormatter)
+parser.add_argument('--near', type=int, default=0,
+                    help = "maximum line distance to make relative")
----------------
nit: the default value 0 basically does nothing, set a reasonable number, 20?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140217



More information about the cfe-commits mailing list