From 5f831719994c94606933a70bc275194efc87b0f4 Mon Sep 17 00:00:00 2001 From: Yuto Takano Date: Wed, 18 Aug 2021 18:03:24 +0100 Subject: [PATCH] Fix listing line number wrongly using start char pos Signed-off-by: Yuto Takano --- tests/scripts/check_names.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/scripts/check_names.py b/tests/scripts/check_names.py index a5cbd70ca..0eba96740 100755 --- a/tests/scripts/check_names.py +++ b/tests/scripts/check_names.py @@ -144,14 +144,14 @@ class PatternMismatch(Problem): # pylint: disable=too-few-public-methods if self.quiet: return ( "{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( "{0}:{1}: '{2}' does not match the required pattern '{3}'." .format( self.match.filename, - self.match.pos[0], + self.match.line_no, self.match.name, self.pattern ) @@ -173,14 +173,14 @@ class Typo(Problem): # pylint: disable=too-few-public-methods if self.quiet: return ( "{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( "{0}:{1}: '{2}' looks like a typo. It was not found in any " "macros or any enums. If this is not a typo, put " "//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) class CodeParser():