Closed fonsecas72 closed 11 years ago
Or maybe phpcsmd could just change its logic and instead of "ignore this extensions/files" it could be "check this extensions/files" and have php - js and css files by default. (?)
What about supporting both? Let the user decide if he/she wants to ignore or include specific regex
supporting both seams good, but how do you plan to do that? making up that regex that I've made may be too difficult for a user not familiar to regex language. also, is it possible that someone wants to validate a pdf file? because wright now that's the default behavior when you check a whole dir.
Ok, this works. It would be better for me as a user if I just put "php,css,js" or "java,txt,png,jpg,gif" instead of editing a regex but for now this is enough. You may close this issue or save it for later improvements ;)
Oh, this is missing from project properties!
That's why i didn't closed it :D
In eclipse we could use patterns to ignore files or folders. We could just do: "/folder/,file.js,/anotherfolder/,anotherfile.php" And this whole folders and files are ignored. I don't know if it is possible/easy enough to apply this logic here but maybe in the eclipse plugin we can learn something ;) https://github.com/PHPsrc/org.phpsrc.eclipse.pti.tool.codesniffer/blob/master/src/org/phpsrc/eclipse/pti/tools/codesniffer/core/PHPCodeSniffer.java
https://github.com/PHPsrc/org.phpsrc.eclipse.pti.tool.codesniffer
Could you test if this works for you?
I don't think so...I've try to ignore (by using both ways) php files and they are beeing scanned even after netbeans restart. This are the settings being save (don't know if that helps :p)
phpcsmd.phpcs.standard=/var/www/project/build/CS
phpcsmd.general.ignorepattern=\\.(svn|git)|\\.(phtml|html|xml|txt|java|svg|png|jpg|gif|php)$
phpcsmd.general.includepattern=(?\!.*\\.(svn|git))(\\.(css|js|php3|php4|php5))$
phpcsmd.general.includestrategy=false
Tested several times. Works for me now.
Maybe the "ignore regex" should be changed so phpcsmd doesn't check for doc, xls, pdf, etc...
I suggest something like this:
This way it will ignore everything that's not "checkable".