cvs: peardoc /en/package/php/php-codesniffer usage.xml

From: Date: Tue, 16 Jan 2007 05:01:45 +0000
Subject: cvs: peardoc /en/package/php/php-codesniffer usage.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-9316@lists.php.net to get a copy of this message
squiz Tue Jan 16 05:01:45 2007 UTC Modified files: /peardoc/en/package/php/php-codesniffer usage.xml Log: Changed 'programlisting' sections to 'screen' sections + minor corrections. http://cvs.php.net/viewvc.cgi/peardoc/en/package/php/php-codesniffer/usage.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/php/php-codesniffer/usage.xml diff -u peardoc/en/package/php/php-codesniffer/usage.xml:1.1 peardoc/en/package/php/php-codesniffer/usage.xml:1.2 --- peardoc/en/package/php/php-codesniffer/usage.xml:1.1 Fri Jan 12 05:18:32 2007 +++ peardoc/en/package/php/php-codesniffer/usage.xml Tue Jan 16 05:01:45 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.php.php-codesniffer.usage"> <refnamediv> <refname>Usage</refname> @@ -9,9 +9,10 @@ <refsect1> <title>Getting Help from the Command Line</title> <para> - Running PHP_CodeSniffer with the <emphasis>-h</emphasis> or <emphasis>--help</emphasis> command line argument will print a list of commands that PHP_CodeSniffer will respond to. The output of <emphasis>phpcs -h</emphasis> is shown below. + Running PHP_CodeSniffer with the <literal>-h</literal> or <literal>--help</literal> command line arguments will print a list of commands that PHP_CodeSniffer will respond to. The output of <literal>phpcs -h</literal> is shown below. </para> - <programlisting> + <para> + <screen> <![CDATA[ Usage: phpcs [-nvi] [--report=<report>] [--standard=<standard>] [--extensions=<extensions>] <file> ... <file> : one or more files and/or directories to check @@ -24,10 +25,13 @@ -h --help : print this help message --version : print version information ]]> - </programlisting> - <para> - The <literal>--standard</literal> command line argument is optional, even if you have more than one coding standard installed. If no coding standard is specified, PHP_CodeSniffer will default to checking against the <emphasis>PEAR</emphasis> coding standard. + </screen> </para> + <note> + <simpara> + The <literal>--standard</literal> command line argument is optional, even if you have more than one coding standard installed. If no coding standard is specified, PHP_CodeSniffer will default to checking against the <emphasis>PEAR</emphasis> coding standard. + </simpara> + </note> </refsect1> @@ -41,30 +45,30 @@ </para> <example> <title>Checking a single file or folder</title> - <programlisting> + <screen> <![CDATA[ $ phpcs /path/to/code/myfile.inc $ phpcs /path/to/code/my_dir ]]> - </programlisting> + </screen> </example> <para> You can also specify multiple files and folders to check. The command below tells PHP_CodeSniffer to check the <filename>myfile.inc</filename> file and all files in the <filename>my_dir</filename> directory. </para> <example> <title>Checking multiple files and folders</title> - <programlisting> + <screen> <![CDATA[ $ phpcs /path/to/code/myfile.inc /path/to/code/my_dir ]]> - </programlisting> + </screen> </example> <para> After PHP_CodeSniffer has finished processing your files, you will get an error report. The report lists both errors and warnings for all files that violated the coding standard. The output looks like this: </para> <example> <title>Sample PHP_CodeSniffer output</title> - <programlisting> + <screen> <![CDATA[ $ phpcs /path/to/code/myfile.php @@ -80,14 +84,14 @@ 88 | ERROR | Line not indented correctly; expected 9 spaces but found 6 -------------------------------------------------------------------------------- ]]> - </programlisting> + </screen> </example> <para> If you don't want warnings included in the output, specify the <literal>-n</literal> command line argument. </para> <example> <title>Sample PHP_CodeSniffer output with no warnings</title> - <programlisting> + <screen> <![CDATA[ $ phpcs -n /path/to/code/myfile.php @@ -102,7 +106,7 @@ 88 | ERROR | Line not indented correctly; expected 9 spaces but found 6 -------------------------------------------------------------------------------- ]]> - </programlisting> + </screen> </example> </refsect1> @@ -114,7 +118,7 @@ </para> <example> <title>Sample PHP_CodeSniffer summary output</title> - <programlisting> + <screen> <![CDATA[ $ phpcs --report=summary /path/to/code @@ -129,14 +133,14 @@ A TOTAL OF 6 ERROR(S) AND 3 WARNING(S) WERE FOUND IN 3 FILE(S) -------------------------------------------------------------------------------- ]]> - </programlisting> + </screen> </example> <para> As with the full report, you can suppress the printing of warnings with the <literal>-n</literal> command line argument. </para> <example> <title>Sample PHP_CodeSniffer summary output with no warnings</title> - <programlisting> + <screen> <![CDATA[ $ phpcs -n --report=summary /path/to/code @@ -150,7 +154,7 @@ A TOTAL OF 6 ERROR(S) WERE FOUND IN 2 FILE(S) -------------------------------------------------------------------------------- ]]> - </programlisting> + </screen> </example> </refsect1> @@ -165,7 +169,7 @@ </para> <example> <title>Sample PHP_CodeSniffer verbose output</title> - <programlisting> + <screen> <![CDATA[ $ phpcs /path/to/code/CodeSniffer -v Registering sniffs... DONE @@ -178,7 +182,7 @@ Processing Sniff.php [133 tokens in 94 lines]... DONE in < 1 second Processing SniffException.php [47 tokens in 36 lines]... DONE in < 1 second ]]> - </programlisting> + </screen> </example> </refsect1> @@ -193,11 +197,13 @@ </para> <example> <title>Specifying a coding standard to use</title> - <programlisting> + <screen> + <userinput> <![CDATA[ -$ phpcs /path/to/code/myfile.inc --standard=PEAR +$ phpcs --standard=PEAR /path/to/code/myfile.inc ]]> - </programlisting> + </userinput> + </screen> </example> </refsect1> @@ -209,12 +215,12 @@ </para> <example> <title>Generating a list of installed coding standards</title> - <programlisting> + <screen> <![CDATA[ $ phpcs -i The installed coding standards are PEAR and Squiz. ]]> - </programlisting> + </screen> </example> </refsect1> </refentry>

« previous php.pear.doc (#9316) next »