svn: /pear/peardoc/trunk/en/package/php/php-codesniffer/ reporting.xml usage.xml
[email protected] (Greg Sherwood) Wed, 12 Jan 2011 05:50:07 +0000
| Newsgroups | php.pear.doc |
|---|---|
| Message-ID | <[email protected]> |
squiz Wed, 12 Jan 2011 05:50:07 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=307399
Log:
Added docs for printing multiple reports and added severity levels to example csv and xml reports
Changed paths:
U pear/peardoc/trunk/en/package/php/php-codesniffer/reporting.xml
U pear/peardoc/trunk/en/package/php/php-codesniffer/usage.xml
Modified: pear/peardoc/trunk/en/package/php/php-codesniffer/reporting.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-codesniffer/reporting.xml 2011-01-12 05:10:09 UTC (rev 307398)
+++ pear/peardoc/trunk/en/package/php/php-codesniffer/reporting.xml 2011-01-12 05:50:07 UTC (rev 307399)
@@ -131,11 +131,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="1.0.0">
<file name="/path/to/code/myfile.php" errors="4" warnings="1">
- <error line="2" column="1" source="PEAR.Commenting.FileComment">Missing file doc comment</error>
- <error line="20" column="43" source="Generic.PHP.LowerCaseConstant">PHP keywords must be lowercase; expected "false" but found "FALSE"</error>
- <error line="47" column="1" source="PEAR.WhiteSpace.ScopeIndent">Line not indented correctly; expected 4 spaces but found 1</error>
- <warning line="47" column="20" source="Generic.Formatting.MultipleStatementAlignment">Equals sign not aligned with surrounding assignments</warning>
- <error line="51" column="4" source="PEAR.Commenting.FunctionComment">Missing function doc comment</error>
+ <error line="2" column="1" source="PEAR.Commenting.FileComment" severity="5">Missing file doc comment</error>
+ <error line="20" column="43" source="Generic.PHP.LowerCaseConstant" severity="5">PHP keywords must be lowercase; expected "false" but found "FALSE"</error>
+ <error line="47" column="1" source="PEAR.WhiteSpace.ScopeIndent" severity="5">Line not indented correctly; expected 4 spaces but found 1</error>
+ <warning line="47" column="20" source="Generic.Formatting.MultipleStatementAlignment" severity="5">Equals sign not aligned with surrounding assignments</warning>
+ <error line="51" column="4" source="PEAR.Commenting.FunctionComment" severity="5">Missing function doc comment</error>
</file>
</phpcs>
]]>
@@ -178,12 +178,12 @@
<![CDATA[
$ phpcs --report=csv /path/to/code
-File,Line,Column,Severity,Message,Source
-"/path/to/code/myfile.php",2,1,error,"Missing file doc comment",PEAR.Commenting.FileComment
-"/path/to/code/myfile.php",20,43,error,"PHP keywords must be lowercase; expected \"false\" but found \"FALSE\"",Generic.PHP.LowerCaseConstant
-"/path/to/code/myfile.php",47,1,error,"Line not indented correctly; expected 4 spaces but found 1",PEAR.WhiteSpace.ScopeIndent
-"/path/to/code/myfile.php",47,20,warning,"Equals sign not aligned with surrounding assignments",Generic.Formatting.MultipleStatementAlignment
-"/path/to/code/myfile.php",51,4,error,"Missing function doc comment",PEAR.Commenting.FunctionComment
+File,Line,Column,Type,Message,Source,Severity
+"/path/to/code/myfile.php",2,1,error,"Missing file doc comment",PEAR.Commenting.FileComment,5
+"/path/to/code/myfile.php",20,43,error,"PHP keywords must be lowercase; expected \"false\" but found \"FALSE\"",Generic.PHP.LowerCaseConstant,5
+"/path/to/code/myfile.php",47,1,error,"Line not indented correctly; expected 4 spaces but found 1",PEAR.WhiteSpace.ScopeIndent,5
+"/path/to/code/myfile.php",47,20,warning,"Equals sign not aligned with surrounding assignments",Generic.Formatting.MultipleStatementAlignment,5
+"/path/to/code/myfile.php",51,4,error,"Missing function doc comment",PEAR.Commenting.FunctionComment,5
]]>
</screen>
</example>
@@ -325,6 +325,40 @@
</refsection>
+ <refsection xml:id="package.php.php-codesniffer.reporting.multiple-reports"><info><title>Printing Mutliple Reports</title></info>
+ <para>
+ PHP_CodeSniffer can print any combination of the above reports to either the screen or to separate files. To print multiple reports, use the <literal>--report-[type]</literal> command line argument instead of the standard <literal>--report=[type]</literal> format. You can then specify multiple reports using multiple arguments. The reports will be printed to the screen in the order you specify them on the command line.
+ </para>
+ <example><info><title>Writing a full and summary report to the screen</title></info>
+ <screen>
+<![CDATA[
+$ phpcs --report-full --report-summary /path/to/code
+]]>
+ </screen>
+ </example>
+ <para>
+ You can write the reports to separate files by specifying the path to the output file after each report argument.
+ </para>
+ <example><info><title>Writing a full and summary report to a file</title></info>
+ <screen>
+<![CDATA[
+$ phpcs --report-full=/path/to/full.txt --report-summary=/path/to/summary.txt /path/to/code
+]]>
+ </screen>
+ </example>
+ <para>
+ You can print some reports to the screen and other reports to files.
+ </para>
+ <example><info><title>Writing a full report to a file and a summary report to the screen</title></info>
+ <screen>
+<![CDATA[
+$ phpcs --report-full=/path/to/full.txt --report-summary /path/to/code
+]]>
+ </screen>
+ </example>
+ </refsection>
+
+
<refsection xml:id="package.php.php-codesniffer.reporting.interactive"><info><title>Running Interactively</title></info>
<para>
Instead of producing a single report at the end of a run, PHP_CodeSniffer can run interactively and show reports for files one at a time. When using the interactive mode, PHP_CodeSniffer will show a report for the first file it finds an error or warning in. It will then pause and wait for user input. Once you have corrected the errors, you can press <literal>ENTER</literal> to have PHP_CodeSniffer recheck your file and continue if the file is now free of errors. You can also choose to skip the file and move to the next file with errors.
@@ -392,4 +426,5 @@
</note>
</refsection>
+
</refentry>
Modified: pear/peardoc/trunk/en/package/php/php-codesniffer/usage.xml
===================================================================
--- pear/peardoc/trunk/en/package/php/php-codesniffer/usage.xml 2011-01-12 05:10:09 UTC (rev 307398)
+++ pear/peardoc/trunk/en/package/php/php-codesniffer/usage.xml 2011-01-12 05:50:07 UTC (rev 307399)
@@ -12,12 +12,13 @@
<para>
<screen>
<![CDATA[
-Usage: phpcs [-nwlsapvi] [-d key[=value]] [--extensions=<extensions>] [--ignore=<patterns>]
- [--report=<report>] [--report-width=<reportWidth>] [--report-file=<reportfile>]
+Usage: phpcs [-nwlsapvi] [-d key[=value]]
+ [--report=<report>] [--report-file=<reportfile>] [--report-<report>=<reportfile>] ...
+ [--report-width=<reportWidth>] [--generator=<generator>] [--tab-width=<tabWidth>]
[--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]
[--config-set key value] [--config-delete key] [--config-show]
[--standard=<standard>] [--sniffs=<sniffs>] [--encoding=<encoding>]
- [--generator=<generator>] [--tab-width=<tabWidth>] <file> ...
+ [--extensions=<extensions>] [--ignore=<patterns>] <file> ...
-n Do not print warnings (shortcut for --warning-severity=0)
-w Print both warnings and errors (on by default)
-l Local directory only, no recursion
@@ -44,8 +45,8 @@
<report> Print either the "full", "xml", "checkstyle", "csv", "emacs"
"source", "summary", "svnblame" or "gitblame" report
(the "full" report is printed by default)
+ <reportfile> Write the report to the specified file path
<reportWidth> How many columns wide screen reports should be printed
- <reportfile> Write the report to the specified file path
]]>
</screen>
</para>