mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Fix listing line number wrongly using start char pos
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
This commit is contained in:
@ -144,14 +144,14 @@ class PatternMismatch(Problem): # pylint: disable=too-few-public-methods
|
|||||||
if self.quiet:
|
if self.quiet:
|
||||||
return (
|
return (
|
||||||
"{0}:{1}:{2}"
|
"{0}:{1}:{2}"
|
||||||
.format(self.match.filename, self.match.pos[0], self.match.name)
|
.format(self.match.filename, self.match.line_no, self.match.name)
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.textwrapper.fill(
|
return self.textwrapper.fill(
|
||||||
"{0}:{1}: '{2}' does not match the required pattern '{3}'."
|
"{0}:{1}: '{2}' does not match the required pattern '{3}'."
|
||||||
.format(
|
.format(
|
||||||
self.match.filename,
|
self.match.filename,
|
||||||
self.match.pos[0],
|
self.match.line_no,
|
||||||
self.match.name,
|
self.match.name,
|
||||||
self.pattern
|
self.pattern
|
||||||
)
|
)
|
||||||
@ -173,14 +173,14 @@ class Typo(Problem): # pylint: disable=too-few-public-methods
|
|||||||
if self.quiet:
|
if self.quiet:
|
||||||
return (
|
return (
|
||||||
"{0}:{1}:{2}"
|
"{0}:{1}:{2}"
|
||||||
.format(self.match.filename, self.match.pos[0], self.match.name)
|
.format(self.match.filename, self.match.line_no, self.match.name)
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.textwrapper.fill(
|
return self.textwrapper.fill(
|
||||||
"{0}:{1}: '{2}' looks like a typo. It was not found in any "
|
"{0}:{1}: '{2}' looks like a typo. It was not found in any "
|
||||||
"macros or any enums. If this is not a typo, put "
|
"macros or any enums. If this is not a typo, put "
|
||||||
"//no-check-names after it."
|
"//no-check-names after it."
|
||||||
.format(self.match.filename, self.match.pos[0], self.match.name)
|
.format(self.match.filename, self.match.line_no, self.match.name)
|
||||||
) + "\n" + str(self.match)
|
) + "\n" + str(self.match)
|
||||||
|
|
||||||
class CodeParser():
|
class CodeParser():
|
||||||
|
Reference in New Issue
Block a user