[llvm] Add PR check to suggest alternatives to using undef (PR #118506)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 03:03:38 PST 2024


================
@@ -312,7 +313,84 @@ def format_run(self, changed_files: List[str], args: FormatArgs) -> Optional[str
             return None
 
 
-ALL_FORMATTERS = (DarkerFormatHelper(), ClangFormatHelper())
+class UndefGetFormatHelper(FormatHelper):
+    name = "undef deprecator"
+    friendly_name = "undef deprecator"
+
+    @property
+    def instructions(self) -> str:
+        return " ".join(f"'{c}'" for c in self.cmd)
----------------
DavidSpickett wrote:

What's the `''` quoting for? If it's shell escaping you could use https://docs.python.org/3/library/shlex.html#shlex.quote.

https://github.com/llvm/llvm-project/pull/118506


More information about the llvm-commits mailing list