[bikeshed] Now with line-numbers in errors!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[bikeshed] Now with line-numbers in errors!

Tab Atkins Jr.
I finally realized how to do accurate, pervasive source-code line
numbers in Bikeshed error messages!

Some happen automatically; errors in your metadata or any datablocks
(<pre class=whatever> things that Bikeshed specially processes) get
line numbers all the time.

Most others you'll need to opt into: run `bikeshed spec -l` (or
`--line-numbers`) to get line-number output.  Unfortunately this mode
is a very hacky, regex-HTML-parsing sort of thing, so Bikeshed
automatically does a "dry run" when you opt in, and doesn't actually
save any output files.  But if this does anything, you have errors in
your document anyway, so that's probably fine. ^_^  When you've fixed
things, just run it without line-numbers and it'll save as normal.

Hopefully this'll help avoid any more annoying 10-minute bughunts!

~TJ

Reply | Threaded
Open this post in threaded view
|

RE: [bikeshed] Now with line-numbers in errors!

Travis Leithead-2
Awesome! This will be a great help going forward, especially for giant specs. Thank you.

-----Original Message-----
From: Tab Atkins Jr. [mailto:[hidden email]]
Sent: Thursday, June 9, 2016 3:56 PM
To: [hidden email] Prod <[hidden email]>
Subject: [bikeshed] Now with line-numbers in errors!

I finally realized how to do accurate, pervasive source-code line numbers in Bikeshed error messages!

Some happen automatically; errors in your metadata or any datablocks (<pre class=whatever> things that Bikeshed specially processes) get line numbers all the time.

Most others you'll need to opt into: run `bikeshed spec -l` (or
`--line-numbers`) to get line-number output.  Unfortunately this mode is a very hacky, regex-HTML-parsing sort of thing, so Bikeshed automatically does a "dry run" when you opt in, and doesn't actually save any output files.  But if this does anything, you have errors in your document anyway, so that's probably fine. ^_^  When you've fixed things, just run it without line-numbers and it'll save as normal.

Hopefully this'll help avoid any more annoying 10-minute bughunts!

~TJ