Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Request #12434 allow several output renderers
Submitted: 2007-11-13 11:32 UTC
From: cweiske Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.0.0RC1)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-11-13 11:32 UTC] cweiske (Christian Weiske)
Description: ------------ It would be cool if one could use several output renderers at once. This would require that an output file could be specified at command line. The feature is neccessary when you e.g. want to generate a complete overview about all files for developers, but only a short summary for status emails. One solution would be to export to xml, and render the xml yourself - but phpcs already has the ability to render txt files, so I don't see why I should reinvent that. I don't know how you implemented rendering, but IMO it'd be good if there'd be a "root renderer" that is used by phpcs internally. this renderer dispatches the logs to all registered renderer objects. That would allow using unlimited renderers for a phpcs sniff call. See http://pear.php.net/package/Event_Dispatcher which does it similar.

Comments

 [2007-11-14 00:15 UTC] squiz (Greg Sherwood)
I've been meaning to clean out the output renderers for a while, but have put it off until after the 1.0.0 release. This should be easy to implement though as the reports are all produced at the end of the run, not during it.
 [2007-11-14 06:15 UTC] cweiske (Christian Weiske)
I have by no means insight if it is possible at all, but for simple renderers it would be helpful if the directly log to disk - that'd keep memory usage lower.
 [2008-02-20 08:53 UTC] jotango (Jan Miczaika)
I think it would be cool to separate report rendering style (csv, txt, html, xml) and report rendering destination (file, stdout).
 [2008-03-07 12:17 UTC] temp (Stephan Wentz)
Yes, seperated Report Renderers and additionally a HTML Renderer would be nice!
 [2008-05-29 15:30 UTC] bender (Bryan Davis)
This functionality will be available through phing in the upcoming 2.4.0 release. See http://phing.info/trac/ticket/214
 [2011-01-10 11:12 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2011-01-10 11:14 UTC] squiz (Greg Sherwood)
You can now print multiple reports for each run and print each to the screen or a file -- Format is --report-[report]=[file] (e.g., --report-xml=out.xml) -- Printing to screen is done by leaving [file] empty (e.g., --report-xml=) -- Multiple reports can be specified in this way (e.g., --report-summary= --report-xml=out.xml) -- The standard --report and --report-file command line arguments are unchanged Full example: phpcs --standard=MyStandard /path/to/code --report-summary= --report-source= Checks code against MyStandard and print the summary report first and then the source report. To print the source report to a file instead: phpcs --standard=MyStandard /path/to/code --report-summary= --report-source=source.txt To print both to files: phpcs --standard=MyStandard /path/to/code --report-summary=summary.txt --report-source=source.txt
 [2011-01-12 11:13 UTC] squiz (Greg Sherwood)
Note that the equals sign is optional for reports being printed to screen. So this is valid: phpcs --standard=MyStandard /path/to/code --report-summary --report-source=source.txt