-
Notifications
You must be signed in to change notification settings - Fork 3
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
[#56] Dump all the errors from different files #141
Conversation
Great catch! 👏 Thank you for fixing this and adding these tests, it really helped uncover lots of issues with the existing code, well done! |
it "Check if ignore link annotation produce error when placed at the end of file" do | ||
let file = "tests/markdowns/with-annotations/no_link_eof.md" | ||
getErrs file `shouldReturn` | ||
makeError (Just $ PosInfo 9 1 9 31) file Link "" | ||
it "Check if ignore paragraph annotation produce error when placed at the end of file" do | ||
let file = "tests/markdowns/with-annotations/no_paragraph_eof.md" | ||
getErrs file `shouldReturn` | ||
makeError (Just $ PosInfo 9 1 9 36) file Paragraph "EOF" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be even better if these 2 new tests were written in bats instead, because then we can see whether the error message printed to stdout is sensible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried this manually, it seems there's a double space in "but found^^EOF"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from that single comment above, LGTM, so I'm pre-approving 😄
Please merge after handling that comment, and I'll cut the 0.2.1 release 🎉
185a752
to
bf5501e
Compare
@Sereja313 Sounds like a good idea!
Whichever way you prefer |
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.
ea21a9e
to
c8d19a3
Compare
Done 🎉 |
Great work @Sereja313! 😄 🎉 |
Description
Problem: Currently, xrefcheck fails immediately after the first observed error because
die
is used right inmarkdownScanner
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 themakeError
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.xrefcheck/tests/Test/Xrefcheck/IgnoreAnnotationsSpec.hs
Lines 18 to 20 in 1b0b8d5
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.Related issue(s)
Fixes #56
✅ Checklist for your Pull Request
Ideally a PR has all of the checkmarks set.
If something in this list is irrelevant to your PR, you should still set this
checkmark indicating that you are sure it is dealt with (be that by irrelevance).
Related changes (conditional)
Tests
silently reappearing again.
Documentation
Public contracts
of Public Contracts policy.
and
Stylistic guide (mandatory)