Commit c6b1c8ef authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

check-news: Show per-file line number



… not the global line number.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent f299ca21
......@@ -51,7 +51,7 @@ def main():
if DASHES_RE.match(line):
if not prevline.startswith("Version "):
raise Exception("Line %s: Invalid title" % (fileinput.lineno() - 1))
raise Exception("Line %s: Invalid title" % (fileinput.filelineno() - 1))
expect_date = True
elif expect_date:
......@@ -66,7 +66,8 @@ def main():
m = RELEASED_RE.match(line)
if not m:
raise Exception("Line %s: Invalid release line" % fileinput.lineno())
raise Exception("Line %s: Invalid release line" %
fileinput.filelineno())
# Including the weekday in the date string does not work as time.strptime
# would return an inconsistent result if the weekday is incorrect.
......@@ -77,7 +78,8 @@ def main():
# Check weekday
if m.group("day") != weekday:
raise Exception("Line %s: %s was/is a %s, not %s" %
(fileinput.lineno(), parsed, weekday, m.group("day")))
(fileinput.filelineno(), parsed, weekday,
m.group("day")))
expect_date = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment