[PATCH] D141463: [clang-tidy] Improve rename_check.py

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 11 05:35:03 PST 2023


ccotter marked an inline comment as done.
ccotter added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/rename_check.py:75
   print("Renaming '%s' -> '%s'..." % (fileName, newFileName))
-  os.rename(fileName, newFileName)
+  subprocess.check_call(["git", "mv", fileName, newFileName])
   return newFileName
----------------
carlosgalvezp wrote:
> I'm not sure it's the responsibility of this check to do git stuff, there may be use cases where this is not wanted / users might not expect this behavior. Introducing a dependency to git might also make this script harder to unit test in the future.
> 
> Thus I think it'd be better to keep the original behavior so the script has one single responsibility. What do you think @njames93 ?
I wasn't sure about this - reverted this. Single responsibility is better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141463



More information about the cfe-commits mailing list