-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dump all the errors from different files #56
Comments
@Sereja313: Andrii had previously started working on this issue. He had a Draft PR (see #87). I'm not sure how close to completion it was - can you please have a look at the PR? Let me know what you think of the PR, and whether you think it's best to just continue working on that branch (it's been a while, rebasing that branch might lead to lots of merge conflicts) or to start from scratch with your own approach. |
@dcastro, It looks like not much has been done, so I started from scratch to avoid merge conflicts. |
@Sereja313 Sounds good! 👍 |
Problem: Currently, xrefcheck fails immediately after the first observed error because `die` is used right in `markdownScanner` What we want is dumping all the errors from different markdowns and then print them as a final xrefcheck's result together with the broken links. Also, despite the fact that in the `makeError` function we have 4 error messages, 2 of them are not reported, and the test case that should check this only checks that at least one of the four files throws an error. Solution: Make xrefcheck to report all errors. Add `ScanError` type and propagate errors to report all of them, rather than failing immediately after the first error is detected.
Problem: Currently, xrefcheck fails immediately after the first observed error because `die` is used right in `markdownScanner` What we want is dumping all the errors from different markdowns and then print them as a final xrefcheck's result together with the broken links. Also, despite the fact that in the `makeError` function we have 4 error messages, 2 of them are not reported, and the test case that should check this only checks that at least one of the four files throws an error. Solution: Make xrefcheck to report all errors. Add `ScanError` type and propagate errors to report all of them, rather than failing immediately after the first error is detected.
Problem: Currently, xrefcheck fails immediately after the first observed error because `die` is used right in `markdownScanner` What we want is dumping all the errors from different markdowns and then print them as a final xrefcheck's result together with the broken links. Also, despite the fact that in the `makeError` function we have 4 error messages, 2 of them are not reported, and the test case that should check this only checks that at least one of the four files throws an error. Solution: Make xrefcheck to report all errors. Add `ScanError` type and propagate errors to report all of them, rather than failing immediately after the first error is detected.
…rom-files [#56] Dump all the errors from different files
Clarification and motivation
As we have right in-place annotations now (
<!-- xrefcheck: ignore <mode>-->
), there can be broken markdowns.For example:
<!-- xrefcheck: ignore file-->
located in the "middle" of the file (not right after the comments at the top) causesError when scanning .\markdowns\with-annotations\no_paragraph.md: expected a PARAGRAPH after "ignore paragraph", but found HEADING (9:1-17)
.<!-- xrefcheck: ignore ile -->
causesError when scanning .\markdowns\with-annotations\unexpected_ignore_file.md: unrecognised option " "ignore ile" perhaps you meant <"ignore link"|"ignore paragraph"|"ignore file"> ( 9:1 - 8:0)
And so on.
Currently,
xrefcheck
fails immediately after the first observed error becausedie
is used right inmarkdownScanner
:And propagated on a higher level, to
Main
.What we want is dumping all the errors from different markdowns and then print them as a final
xrefcheck
's result together with the broken links.A possible solution is to add a custom exception type for scanner errors, this way exceptions can be reasonably caught outside if necessary (not in inner components).
Acceptance criteria
die
in inner components.The text was updated successfully, but these errors were encountered: