Added some formatting to parse errors for dicts and lists in options

Review Request #1495 - Created Dec. 17, 2014 and submitted

Information
Eric Ayers
pants
zundel/format-config-error-in-options
873
f5d014f...
Reviewers
pants-reviews
benjyw, jsirois, lahosken

Added some formatting to parse errors for dicts and lists in options. On a syntax error in a list or dict, the exception message now prepends a relative line number. I had a list that had about 30 lines and had a hard time spotting the syntax error in the output.

Add a typo to the list defined in the 'backends' section of pants.ini:

Exception message: No valid list for backends.packages: [
"internal_backend.optional",
"internal_backend.repositories", ()*&
"internal_backend.sitegen"
]
invalid syntax (<string>, line 3)

after this change:

Exception message: No valid list for backends.packages:
01: [
02: "internal_backend.optional",
03: "internal_backend.repositories", ()*&
04: "internal_backend.sitegen"
05: ]
invalid syntax (<string>, line 3)

Also, when using the cmdline:

Error while parsing option value []: Value is not of the acceptable types: (<type 'dict'>,)
1: []
John Sirois
Benjy Weinberger
Larry Hosken
Eric Ayers
Eric Ayers
Eric Ayers
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

commit bbd5e1af4994d3abffddfb4e9d2bc121a26703f0

Loading...