[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):
----------------
DavidSpickett wrote:
It's a little strange this being in code-format-helper.py but that's perhaps more the naming of the file than this being in the wrong place. If we think of this as "stuff that runs on the changed lines" then it's not so weird. Plus you get for free the feature that updates the comment once the PR author fixes it, duplicating that would be annoying.
I would at least override pr_comment_text_for_diff because the explanation from the tool is not a diff. Also if you do that, you can present it as Markdown with code blocks so it's nicer to read.
https://github.com/llvm/llvm-project/pull/118506
More information about the llvm-commits
mailing list