mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-04 15:39:53 +00:00
Print line number next to problem in check-names
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This commit is contained in:
parent
bcc3d99cc1
commit
381fda8550
@ -63,10 +63,15 @@ class Match(): # pylint: disable=too-few-public-methods
|
||||
self.name = name
|
||||
|
||||
def __str__(self):
|
||||
ln_str = str(self.pos[0])
|
||||
gutter_len = max(4, len(ln_str))
|
||||
gutter = (gutter_len - len(ln_str)) * " " + ln_str
|
||||
underline = self.pos[1] * " " + (self.pos[2] - self.pos[1]) * "^"
|
||||
|
||||
return (
|
||||
" |\n" +
|
||||
" | {}".format(self.line) +
|
||||
" | " + self.pos[1] * " " + (self.pos[2] - self.pos[1]) * "^"
|
||||
" {0} |\n".format(gutter_len * " ") +
|
||||
" {0} | {1}".format(gutter, self.line) +
|
||||
" {0} | {1}".format(gutter_len * " ", underline)
|
||||
)
|
||||
|
||||
class Problem(): # pylint: disable=too-few-public-methods
|
||||
|
Loading…
x
Reference in New Issue
Block a user