hokein added inline comments.

================
Comment at: llvm/utils/relative_lines.py:45
+for file in args.files:
+    contents = open(file).read()
+    failures = 0
----------------
it would be nice to make the script more robust (capture and bailout the 
`UnicodeDecodeError` exception)-- there are some test files that contain 
invalid utf-8 characters


================
Comment at: llvm/utils/relative_lines.py:94
+    for pattern in args.pattern:
+        contents = re.sub(pattern, replace_match, contents)
+    if failures > 0 and not args.partial:
----------------
looks like we modify the file more eagerly -- if there are no matching pattern, 
we will replace the content as well (most cases are ok, I saw the CRLF => LF 
change, I think we'd better only overwrite the content if there are matching 
patterns). 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140217

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to