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
tidy's error messages should include filename somewhere #713
Comments
yes, it would be nice if the ending but until tidy is changed, a work-around is
|
@petdance this request has come up several times. The earliest I found was #53, in which you participated... is a repeat of #178, and mentioned in #241, and maybe others... So the first answer is try the
|
Since this is an old topic, how about treating it as a documentation issue? so the man page changes from:
to something along the lines of:
Have you considered adding an |
@ler762 thank you for the feedback, and getting involved... we welcome that... Well I too am certainly all for having a
And this is not only for the And I would not skimp on the definition, description, like maybe -
Or something like that... Why do you not present a PR?
You could even go the whole hog, and fork https://github.com/htacg/html-tidy.org, clone this and generate the API docs locally to see how your changes look there as well... And likewise would welcome the addition of say an I presently do not fully understand how these are generate using So yes, maybe this is more a documentation issue, and look forward to your further help... thanks... |
@geoffmcl I can work on creating a PR I'll work on adding
|
Guys, no synonyms, please. Either change the option name, or leave it alone. We've worked hard to eliminate synonyms in the past, and to remove deprecated options, and to organize them them a bit better. Adding synonyms does nothing for functionality. I'm fine with changing the name, but please use the deprecation mechanism to support the old name short term. I can help with this, since no one has used the new mechanism yet. Additional documentation is always welcome, and that goes for any of the other options, too. |
@balthisar what is so wrong with having I see it now and again in unix I use a system of And as you know I am not big on your While @ler762 thanks for the further feedback... First improving the description for the Who would not undestand, or missunderstand And then there is the use of non-words, or If you really feel strongly about this then at least go back to your original Concerning a PR, as mentioned the first step is to And While others have presented PR's with other languages also changed, and re-generated For creating a new option like Look forward to your help... thanks... |
I don't object to synonyms using the CLI app; I'm simply asking that no one consider polluting the library with non-core junk. The request is for user interface enhancement, which belongs in the CLI app. Use the |
@balthisar changing the option name would be extremely user-hostile. How about @geoffmcl I'll go back to |
@ler762, there's actually a mechanism to accept deprecated names as a means to transition users to use the new names of options, but I agree, there's no reason to rename something that works. Do you want the proposed In the former case, given the existence of |
@balthisar, @ler762 hmmm, adding a And FWIIW, is already there if you use the special DEBUG build mode, If this option is detected, and is not the special debug build, send the filename to The only drawback here is that it can not be enabled in a config file... becomes one of the options that does not have a As to using What? Add such a callback to console Talk about Alternatively, as suggested here in my first comment, and mentioned by @ler762, a new option And @ler762, as stated not too concerned about the new wording for the As sometimes happens, lots of differing ideas here... I think I would be swayed towards the first single hythen Look forward to further comments... thanks... |
It's an infrastructure service that could potentially be used for allowing other console switches to work in configuration files, e.g., |
I'm a very slow writer, so while I'm working on a reply I'll just just put this out for review |
@balthisar even after googling it, not really sure what a monkey patch is, or at least how it applies here, nor what is the lot of monkey patches you refer to, especially the idea of a lot, but no problem ;=)) Certainly see Either such a configuration item is part of the @ler762 thank you for PR #715... This looks fine. I have a small backlog of PR's that I need to get too first, but will get to it, eventually... One small note is that you seem to have done this in
But like I say, may not be a problem... I have experimented with implementing a simple Have found one interesting thing. If this output is put to a error file, with say Would be appreciated if you, and others, could pull this |
I'm for the ability to emit the filename. There's a demonstrated use case. But this is a client feature, not a library feature. If we want to support That callback has been there since the dawn of time. Actually, the one I mentioned is a bit newer; it corrects the faulty design of the original by providing a reference to the Tidy document in question. This wasn't a monkey patch. It's proper design for a client-server (client-library) model, and is part of the original, intended design. @geoffmcl, you tend to overlook the fact that LibTidy is a library, and the console application is a consumer of the library, and you tend to want to give special privileges to console. In modern terms, they're very tightly coupled, and there's no reason to be. For example, there's no reason on Earth that LibTidy needs the ability to report the input filename to an output buffer. That onus falls completely on the client program. And the same really goes for other things like The right thing to do would be to remove all of the option names from the library completely, and let the client deal with them. This would contribute significantly towards the ability to internationalize the option names without spoiling the integrity of the library. The library shouldn't care about Despite all of these flaws, I have no intention of fixing them. There are other priorities. But at the same time, I will crusade against adding crap to the library when it can be handled perfectly well in the client, and that goes for synonyms that have no place in a library, and for adding additional output that doesn't involve the library at all. I'll reiterate: I'm for the ability to emit the filename. There's a demonstrated use case. But this is a client feature, not a library feature. If we want to support |
@ler762 thank you for the extension of PR #715. An entirely new config type option This makes my What about the case where there are no error or warnings? Now we would be back to no filename shown anywhere, and I think there should be, even in this happy case, if I asked for That could be done in And a mention in the documentation of slightly different options - one where What do you think? Thanks... |
Given that this is not a synonym, then +1 for support. Also support @geoffmcl's proposal to output the filename in (Plus, @geoffmcl, it might be simpler to localize. Right now your I don't think that cross-referencing is important in this case because these options are not synonyms, and are in no way related to each other other than that the both (coincidentally) indicate the filename of the input file. @ler762, if you want to "complete" your PR with the cross-references, have a look at Then add them each to The man page will automatically include the xrefs next time the project is built on Unix, and the documentation sets will automatically pick them up next time they're built against this executable. |
@balthisar thanks for the instructions on how to add the cross references @geoffmcl it didn't take me long at all to get to the 'blow everything away and start over' stage :)
No - I see it as a progress indicator. If you're running tidy on a lot of files that are mostly correct, I can see how it'd be nice to have each filename listed so you know the process isn't hung.
I like the |
@ler762, you don't really need a "see also"; the xrefs will take care of that, but maybe just a quick note on Just a quick note on formatting: there's no need for trailing backslashes on interrupted lines. C only cares about whitespace in certain, limited circumstances. It doesn't hurt; you're effectively escaping the carriage return, but just weird to look at outside of a Unix shell. |
@ler762 thanks for the addition of the Still to check a docs gen to see what I get. @balthisar can't remember are the And not so certain we need to say anything about Since we seem to all agree that it would be a good thing to also show the filename even when there are no warnings or errors... more or less extracted from my now dead diff --git a/console/tidy.c b/console/tidy.c
index 4afbc04..928630e 100644
--- a/console/tidy.c
+++ b/console/tidy.c
@@ -2405,7 +2405,15 @@ int main( int argc, char** argv )
if ( argc > 1 )
{
htmlfil = argv[1];
- DEBUG_LOG( SPRTF("Tidying '%s'\n", htmlfil) );
+#ifdef ENABLE_DEBUG_LOG
+ SPRTF("Tidy: '%s'\n", htmlfil);
+#else
+ if ( tidyOptGetBool(tdoc, TidyShowFilename) )
+ {
+ fprintf(errout, "Tidy: '%s'", htmlfil);
+ fprintf(errout, "\n");
+ }
+#endif
if ( tidyOptGetBool(tdoc, TidyEmacs) || tidyOptGetBool(tdoc, TidyShowFilename) )
tidySetEmacsFile( tdoc, htmlfil );
status = tidyParseFile( tdoc, htmlfil ); Note I have reduced to the product name Have not yet done our regression tests, but again since it is an As stated, I have a backlog of PR's to get to, and prefer to do them in order, so the This is of course another reason why such changes are done in a fork And @petdance, as the openner of this issue, do you have any further comments? thanks... |
Love the new
Even tried a @ler762 thank you for PR #717... this worked fine, even though it showed @petdance assume we can close this... feel free to re-open if I missed something, or add a new issue... thanks... |
When I run
tidy
from the command line on multiple files, I can't tell which file the errors apply to:Running without the
-q
doesn't show me the filename either.The text was updated successfully, but these errors were encountered: