Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit d2a836e

Browse files
committed
Fixed error message formatting
1 parent 1fb9963 commit d2a836e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pydocstyle.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import ast
1414
import copy
1515
import logging
16+
import textwrap
1617
import tokenize as tk
1718
from itertools import takewhile, dropwhile, chain
1819
from re import compile as re
@@ -487,13 +488,14 @@ def parse_definition(self, class_):
487488
return definition
488489

489490
def check_current(self, kind=None, value=None):
490-
msg = """Error at line {self.line}:
491+
msg = textwrap.dedent("""
492+
Unexpected token at line {self.line}:
491493
492494
In file: {self.filename}
493495
494496
Got kind {self.current.kind!r}
495497
Got value {self.current.value}
496-
""".format(self=self)
498+
""".format(self=self))
497499
kind_valid = self.current.kind == kind if kind else True
498500
value_valid = self.current.value == value if value else True
499501
assert kind_valid and value_valid, msg

0 commit comments

Comments
 (0)