You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that, and ideally being able to print a line number in more cases, it would be straightforward to create a GitHub Action that would annotate the source where the errors are. Proof of concept: w3c/webdriver-bidi@ccd32f9#annotation_222823575
The text was updated successfully, but these errors were encountered:
I'm not seeing how anything you're suggesting here would address the hackiness - did you intend them to?
It's hacky because, even tho LXML exposes a lineNumber attribute on its elements, that attribute is always None. The documentation claims it should work and offers no caveats, but it never has, so I dunno. Instead, I run a regex over the lines, looking for things that might be start tags and putting a line-number attribute on them. This, obviously, can misfire on things that are start-tag-like but wouldn't be recognized by the parser, like code in <xmp>; this doesn't affect the accuracy of the line numbers, but it can corrupt your output, thus why I turn off output.
I didn't know in what the hackiness consists, so I thought "ideally being able to print a line number in more cases" would cover it. Sounds like it can also be wrong, then :)
Closing this - due to the gradual switchover to my bespoke HTML parser, most error messages now have non-hacky line numbers (and the branch I'm working on right now will add/improve even more).
Bikeshed has a
--line-numbers
argument which will sometimes print the line an error was associated with. However, it's documented as hacky:Feature request: use https://www.gnu.org/prep/standards/html_node/Errors.html or something with a consistent pattern for errors, especially including the source file (#1516 is related)
Given that, and ideally being able to print a line number in more cases, it would be straightforward to create a GitHub Action that would annotate the source where the errors are. Proof of concept:
w3c/webdriver-bidi@ccd32f9#annotation_222823575
The text was updated successfully, but these errors were encountered: