-
Notifications
You must be signed in to change notification settings - Fork 429
Message Handling "cleanup" #561
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
Comments
@balthisar thanks for this issue... sorry for the small delay on this... I must have read, and re-read this message umpteen times, or more!, but still a little unclear on exactly what you are proposing... sorry... Does it come down to a But some other things you touched on - buffer all of the document message output As you point out, an app using But should our console sample use of As you do understand, the current order is the result of the phases tidy goes through... As you get to know tidy this in itself is a clear indication of which phase the warning, error, came from... It works great for debug mode, where I even output more messages... And take an extreem example of a crash, a segfault, now we would see nothing... the user would not be able to give us some indication of what output was already given before the event... and neither would I see them in debug mode... So, no I do not think the messages should be buffered, or sorted... by libtidy or console tidy... and as you agree a 3rdParty app using libTidy can already do this... Let them offer a Where is the gain for HTML Tidy? More maintenance... And the new suggested As an additive option, the users have the choice of what to use... we should not be the dictator, or arbiter, of what is best in this regards... no matter how more logical you think this would be... And so far none of this really touches what is started in #412... and we have had other requests to improve the message content, especially when libTidy has applied a fix. And I agree some messages should perhaps be much more explicit about what libtidy is doing... But that does not seem to suggest we should And I, like others, get confused by some message, like say Then there are the so called You do make a good point that maybe Did I miss something in your comment? Please bring it up again if I did... But this at least gives you some of my perspective on this -
In fact maybe each of these could be a separate issue... discussed, decided... certainly not all lumped together under the catch-all title Message Handling "cleanup"... As stated, still quite confused... what cleanup do you want to do? Thanks... |
@balthisar maybe your But a rough review of the 130K diff file, shows some alarming things... If this is truely an experiment, and will be deleted, then skip this quick review... no problem... sorry for the noise...
Now, as expressed, maybe everything read is good for tidy, but there is no way such a melange of changes can be accepted without some discussion, justification, item by item... sorry... As my first post indicated, split this up... show the new messages, and the reason, discuss the changes in the severity level of certain messages, if this is what is intended, and so on, and on... Wow, we love the enthusiasm, and the effort put into this, but this is granddaddy tidy we are talking about... please take it easy... step by step... incremental... Please respect the collaborative process... I could also open an all inclusive issue Maybe just a voice in the wilderness, previously accused of |
@balthisar I cycle back to this... given that in every proposed change there must be an element of truth, and with that, maybe benefit... so I seek to find that... embrace that... accept that... Ok, the biggest change here is to rename So you want to move the To me, everywhere, and anywhere, tidy wants to Does this not make sense? Seem very logical? Or have I got something real wrong... please tell me... explain why such a distributed system is better, benefits a libTidy developer, than exactly one Explain why sprinkle, throughout tidy library code, such various categories of reports, is some how better, more logical, easier to understand, to a developer... I do not see it! And I suppose oppose it... And this has nothing to do with the introduction of some new Really, just seek understanding here... not opposition... thanks |
@geoffmcl, thanks for the many walls of text. I won't address all of them right now, as I'm back from camping. The main point of the feature request is to start a public discussion, and you've provided a lot, which complements my huge wall of text.
Possibly, but only considering the overall messages and deprecating the redundant options.
Comment made in passing. I have no intention of doing this, but it would be user-friendly.
Windows only, unfortunately. I made a commitment to you to make this cross platform, and I'll do that eventually, as it's clearly useful. However that's invisible to most users.
Generally, I'm not afraid of maintenance, as that's the commitment that we made for Tidy. I'm referring to maintenance in general, not in sorting output (as I said, not on the radar for me right now). It also means that I'm not afraid of things the potentially reduce future maintenance, even if they're large merges that fundamentally change internals. External API stability is important, but as we're working with
Actually the message system was massively revamped when we added the new extensible callback API. What I failed to do then was categorize every message, and determine the reason for its output. Most of the errors/warnings are obvious, but there's other seemingly random output that's beyond the users' control. When I say "revamp" now, I mean inventory every bit of output, categorize it, and allow the user to control what he or she sees, while at the same time, improving the flexibility of what we can output, without being so rigid. The messaging system is an example of something that's been patched and patched and patched over and over again, and rather than adding another patch, I'm trying to understand how it can be generalized, what's involved, and even if it's possible.
If something's been around for 17 means means that it's good enough, then we should simply stop maintaining Tidy! It's obviously good enough!
Yes! That's the ultimate goal. This branch was pushed here instead of my repo. It's not a proposed PR, and it's mostly a learning exercise to see what's possible. It's definitely a WIP, and probably out of place for discussion in this issue thread. However, what I'm trying to do is:
I keep using the word "generalized." As a concept, it's not even that modern, but generalization is an important model that, while sometimes tough to implement, makes future maintenance simpler, reduces future API churn, and makes implementation of new or updated features that much easier. Infrastructure is a pain in the ass, but sometimes it's good for the long-term health of a project. For the most part, ignore this branch for now. It's completely experimental while I continue to learn why and when Tidy spouts what it does, and develop a possibly generic approach to handling messages. I'll get there, or fail. Localization started off as an experiment, and the new callback API started as an experiment, and they were both huge changes that helped Tidy rather than hurting it. Have some confidence that I won't propose something that hurts Tidy. |
@balthisar it was only recently that I realized I had done the diff backwards - new-to-old, instead of old-to-new - but you can see I clearly liked the one-Report-to-rule-them-all function ;=)) and even thought for a moment that was what we had! For issue #456 I was just looking at how can I add a new message like We have say the So I agree the problem with a single But again I would really suggest you separate what you want to do into different, completely separate, issues, like - just taken from the big diff -
These have nothing to do with this idea of I do understand the Look forward to further |
I'll close this in favor of individual feature requests. |
I started to write this in response to #412, but it's actually a broader issue, and I'd like to spur some discussion on a bit of refactoring to simplify Tidy, as well as address #412.
In #412, we're looking for a way to allow Tidy to show additional information whenever it performs any type of fix, including the fixes that are currently "quiet" fixes. The original proposal was to add another new configuration option to the mix. Instead, I'd like to step back and see if we can simplify this completely.
Currently we have messages categorized per this enum:
Nominally only
TidyWarning
andTidyError
result in a non-zero exit code from the CLI, although file errors and the like can change the exit code, too.The
TidyInfo
isn't used very much; perhaps it should be used a little bit more for cases like this, i.e., "silent changes" becomeTidyInfo
messages that we can handle appropriately. Or maybe we insert a new category betweenTidyInfo
andTidyWarning
, e.g., `TidyTouchup" or something.Before considering yet another new option, though, what do we already have?
show-info
will squelch anyTidyInfo
messages, but it also squelches some of the "dialogue-like" output that Tidy delivers (the newTidyDialogueInfo
) category.show-warnings
can be used to hide the warningsshow-errors
isn't a boolean, but places a limit to the amount of errors that will be output, and setting this to zero does squelch all errors. Now the thing aboutshow-errors
is that it only limits errors, not warnings or info. So if you setshow-errors
to, say, 10, but have 100 warnings, you'll still see all of them.If you're using a callback filter, none of these options have any effect, as it becomes the responsibility of the host program to implement all of this functionality.
All of the document-related messages are generated and output in the order they are detected during Tidying, so the message-table output is a mix of warnings and errors, and not necessarily in document line number order (e.g., from the lexer, from the parser, from the post-processing that Accessibility produces).
Tidy's output is also mixed in that document-related messages can be interspersed with operational messages. For example, missing config file isn't related to a document issue but precedes the document information table. The Accessibility message interrupts the document message table for no good reason, and finally summary information and other dialogue-type information is added at the end.
So, what would we do if we were starting from scratch?
What I would do is eliminate all of these filtering and limited functions from LibTidy completely, and move them to the CLI, and let the CLI handle this stuff just like any other LibTidy user is expected to do. I tend to think that this would be an unpopular move, though, and it would complicate configuration files, and we have a rich history of allowing these options in the config file. So, I won't go there.
I think we need to carefully define the granularity that is expected from document messages versus dialogue messages, and attack them separately.
To handle the document messages, I suggest that we eliminate
show-warnings
andshow-info
entirely, and replaceshow-errors
with something else. Instead, we have a newshow-document-messages
option with the values possible values of "None" or "Quiet", "Errors", "Warnings", and "Info", each of which show progressively more information.I would also buffer all of the document message output, and emit it in line and column number order instead of the current order, which is line and column order for each piece of Tidy handling the code. I don't think we support any embedded systems with such little memory that we can't spare a few K to hold document messages in memory until we're done Tidying, so that we can sort them. However, is a bit tricky because
tidyParseFile()
(or stdin),tidyCleanAndRepair()
, andtidyRunDiagnostics()
each produce their own messages. Maybe for a "phase 2" down the line...show-errors
would also be replaced withlimit-document-messages
which limits the number of messages, not just the number of errors.Moving on, there are also several other types of non-document messages that are one of the "dialogue" message types. Things such as reporting missing config files, giving helpful information, giving the error count summary, showing information about Tidy, are all "dialogue" type messages. Right now both
show-info
andquiet
affect these, but it's not currently clearly, logically defined what and why certain pieces of this information is hidden.Maybe we replace
quiet
andshow-info
with another enum type option, e.g., "show-other-messages" with values that bring some sanity to this.The text was updated successfully, but these errors were encountered: