-
Notifications
You must be signed in to change notification settings - Fork 5
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
Display violations detected (fix #7) #44
Conversation
9713c27
to
9e770be
Compare
9e770be
to
d93881b
Compare
@ulysses4ever : Thanks for taking this on! While you are redoing the check output, I wonder whether we should switch to a standard error message format. I only found the GNU standard when googling for such a thing: https://www.gnu.org/prep/standards/html_node/Errors.html
This could lead to an awful repetition of
Approved!
At least in the context of
In general, any violation could be rendered with some error background color, like red. |
There are several things that I address in order below, but tldr; is: I can add General comment. I'm generally open to anything that (at least, barely) works for my use case, which is: looking at the output in CI and figuring out what's wrong by inspecting the output. Note that this is quite different from your (implied) use-case: Emacs integration, but perhaps one is not mutually exclusive with another. Another thing: I'd prefer to merge any minimal-working-prototype and iterate in another PRs, if possible. I'm happy to apply quick fixes as a part of this PR. But I will probably not have enough time to implement sufficient improvements here. Format of errors. I was rather looking into something like errata, so something prettier rather than something that would please Emacs. I'm not opposed to file:line:column-range. The bigger issue here is that the current patch doesn't track columns. That would require quite some surgery on the lowest-level functions that do the actual fixing. I am not willing to implement it as a part of this PR. I can switch to Colors. That would be nice but I've never used terminal libraries, so the amount of my work needed here exceeds what I can contribute as a part of this PR. Tabs. I don't care much how exactly tab is rendered. I find
you mean "instead of →"? Because I don't use literal |
Thanks again, @ulysses4ever:
Details like renderings of tabs and trailing newlines can also be changed easily at a later stage. Btw, if you rebase onto
|
Yeah, I know the control sequence business in general, and it was fun to read the SE thread you referenced (thanks for the reference!). I'll bump the bound, thanks for noticing. Question: do you want this output in both |
Sure, works for me!
Ideally, in |
By "prefixed", do you mean:
or
I'm no big fun of it because it doesn't seem to improve either substance or presentation. Maybe I just don't know how to do it pretty. But I can add it. Just tell me which one. Currently, I don't store the fixed lines, only the original ones. How about I only print problematic lines in the
My current guess is that I have |
e081f61
to
90db032
Compare
By prefixed I meant beginning of the line, so it looks like a checklist. But ok to skip this if you don't think it helps.
Yes, that's fine.
Ok, I see. Generally, it is fine to drop such old GHCs if they cause complications. After all, At the moment, |
Thanks a lot, Andreas, for engaging and helping to nail it! A hackage release would be appreciated, so that we start ripping the benefits :-) |
@andreasabel would it be possible to have a Hackage release with this patch? |
I wanted to add a testsuite before that (#45), with |
Oh, so you're on it, good. No rush, of course. Just one thought: if tests take more time than expected and you want to do no more than one release in the near future, then, perhaps, releasing without tests and then adding them only on Github is no big deal: I think tests are less important on Hackage... |
@ulysses4ever : While testing, I observed that the following violation does not produce an error: Line 21 in eb7062c
I have to investigate. Ah, I understand why. After breaking the file into lines, we cannot observe anymore whether the last line ended in a newline character. So maybe we have to implement our own line-breaking function which gives an error if the last line does not end with newline. |
@ulysses4ever : I also realize that performance degrades for large files. E.g. with a file that has 200,000 lines of just a space character, we get the following runtimes: Before:
With the PR:
So we regress from 0.1s to 30s for this example. I suspect there is a quadratic factor in using the |
Do you mean it's a regression after this patch? |
Yes. |
Wow, a lot of exciting data! Could you share the file you used for benchmarking. There's a trick with Writer [a] that usually helps (using censor instead of tell)... |
This does not help... (no observable timing difference to just lists). |
@ulysses4ever: I pushed my work on testsuites and reported the two issues discussed here:
I think these should be fixed before releasing. Would you have time to work on them? If yes, please drop a comment at the respective issue(s). (I am not sure how much time for it I have from tomorrow on.) |
Of course, this should not be released as is. I'll try to work on fixing it. I can't promise any timeline though. |
Just to make sure: performance regression does come from this patch, but the issue with the trailing newline in the last line has nothing to do with it? |
Since this patch, |
This looks like this:
So, I display line numbers and also make visible all spaces and tabs in the violating lines, so that it's easier to see what's happening, in particular, I show:
<empty line>