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.
17 lines
826 B
Plaintext
17 lines
826 B
Plaintext
# REQUIRES: python
|
|
#
|
|
# RUN: mkdir -p %t.root
|
|
# RUN: mkdir -p %t.home
|
|
# RUN: cp %S/Inputs/.lldbinit %t.root
|
|
# RUN: cp %S/Inputs/syntax_error.py %t.root
|
|
# RUN: cd %t.root
|
|
# RUN: env HOME=%t.home %lldb-init -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=WARNINIT --check-prefix=CHECK
|
|
# RUN: env HOME=%t.home %lldb-init -local-lldbinit -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=ALLOWINIT --check-prefix=NOINIT
|
|
# RUN: %lldb -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=NOINIT --check-prefix=CHECK
|
|
|
|
# WARNINIT: warning: there is a .lldbinit file in the current directory which is not being read.
|
|
# NOINIT-NOT: there is a .lldbinit file in the current directory which is not being read.
|
|
# CHECK-NOT: bogus
|
|
# ALLOWINIT: name 'prlnt' is not defined
|
|
# ALLOWINIT: bogus
|