[all-commits] [llvm/llvm-project] 37a8c7: [lldb] Assert lack of trailing period or newlines ...
Jonas Devlieghere via All-commits
all-commits at lists.llvm.org
Fri Apr 17 12:16:05 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 37a8c718182a1dc25e46ae2295f172abb3791d78
https://github.com/llvm/llvm-project/commit/37a8c718182a1dc25e46ae2295f172abb3791d78
Author: Jonas Devlieghere <jonas at devlieghere.com>
Date: 2026-04-17 (Fri, 17 Apr 2026)
Changed paths:
M lldb/source/Commands/CommandObjectDWIMPrint.cpp
M lldb/source/Commands/CommandObjectDisassemble.cpp
M lldb/source/Commands/CommandObjectSource.cpp
M lldb/source/Commands/CommandObjectThread.cpp
M lldb/source/Interpreter/CommandInterpreter.cpp
M lldb/source/Interpreter/CommandReturnObject.cpp
M lldb/source/Target/Thread.cpp
M lldb/test/Shell/Commands/command-disassemble-process.yaml
M lldb/test/Shell/Commands/command-disassemble.s
M lldb/test/Shell/Commands/command-list-reach-beginning-of-file.test
M lldb/test/Shell/Commands/command-list-reach-end-of-file.test
M lldb/test/Shell/Driver/LocalLLDBInit.test
Log Message:
-----------
[lldb] Assert lack of trailing period or newlines in diagnostics (#191447)
This PR adds an assert to `CommandReturnObject::{AppendNote,
AppendWarning}` to ensure the diagnostics don't end with a newline,
which is added by the function, or a period, which goes against the
coding standards.
I added a little helper that asserts in assert-enabled builds and trim
the diagnostic otherwise. I know that goes against the notion that
"asserts are preconditions" and therefore you shouldn't handle the case
where they don't hold (something I generally advocate for) but I think
we should prioritize a consistent user experience over purity.
We should do the same thing for `AppendError`, but currently there are
still too many violations that need to be cleaned up and if the compiler
emits non-compliant diagnostics, we may not be able to do this at all.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list