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

Request #12544 extended --ignore pattern behavior
Submitted: 2007-11-28 22:07 UTC
From: farell Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.0.0RC2)
PHP Version: 5.2.4 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2007-11-28 22:07 UTC] farell (Laurent Laville)
Description: ------------ phpcs CLI has already an option to ignore file(s) and directory(ies) from parsing. phpcs [--ignore=<pattern>] <file> Is it possible to change/upgrade its behavior and allow to : READ a .cvsignore file contents to ignore all files/dir identified inside. PEAR_PackageFileManager has something equivalent : @see [1] lines 106+ 109 (for merging options) Why I ask this ? Because I think it could be usefull when a batch script run a large analysis of many files/packages (as Christian Weiske did [2]) and we don't know (for each package) what are the files to exclude. Also, consider that command line as a limit, and we can expect to have a command like : phpcs --ignore=blah,blah,blah,blah,blah,blah,blah,blah,blah .... blah,blah,blah, ... very long list ...,blah,blah <file> Example : Yesterday I've commit some CS fixes on HTML_CSS, and I don't touched to CSS\Advanced.php because it's an old file written by Klaus Guenther. And this file was never be included in any public PEAR release of package HTML_CSS. Report of Christian [2] is in this way a bit bogus, because CSS\Advanced.php is included and gave me again 42 errors and 12 warnings, while I just hope to have 12 errors and 0 warnings with phpcs 1.0.0RC2, and 0 error, 0 warning when 1.0.0RC3 will be released (fixing @throws tag must contain a comment) Thanks Greg ! [1] http://cvs.php.net/viewvc.cgi/pear/PEAR_PackageFileManager/PackageFileManager/Cvs.php?annotate=1.15 [2] http://pear.cweiske.de/overview.htm

Comments

 [2011-01-13 05:57 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
I think I might close this because things have changed significantly since it was suggested. Now, creating a new standard is as easy as creating an XML file. Ignore patterns can be hard-coded into it, and ignore patterns can even be changed for each sniff. So the suggestion now is to create a standard that matches the project you are working on. This might be as simple as importing an existing standard and just adding ignore rules. You also have the option now of ignoring whole files or sections of a file using comments. I prefer these methods over people leaving files like cvsignore around and having to commit them.