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
1 changed files with 8 additions and 3 deletions
|
@ -63,10 +63,15 @@ class Match(): # pylint: disable=too-few-public-methods
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def __str__(self):
|
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 (
|
return (
|
||||||
" |\n" +
|
" {0} |\n".format(gutter_len * " ") +
|
||||||
" | {}".format(self.line) +
|
" {0} | {1}".format(gutter, self.line) +
|
||||||
" | " + self.pos[1] * " " + (self.pos[2] - self.pos[1]) * "^"
|
" {0} | {1}".format(gutter_len * " ", underline)
|
||||||
)
|
)
|
||||||
|
|
||||||
class Problem(): # pylint: disable=too-few-public-methods
|
class Problem(): # pylint: disable=too-few-public-methods
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue