benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
812 stars 126 forks source link

Exclude Pattern? #69

Closed jrahmy closed 11 years ago

jrahmy commented 11 years ago

I have files that end in something like .twig.php for templates that should not be code sniffed. Currently there are only options to whitelist extensions.. would it be possible to exclude these template files somehow?

benmatselby commented 11 years ago

This is now present in the master branch.. You will want to configure "extensions_to_blacklist" and it is documented here: http://www.soulbroken.co.uk/code/sublimephpcs/

jrahmy commented 11 years ago

Awesome, thank you!

boboldehampsink commented 9 years ago

Is there also a way to exclude directories? I have vendor code that is using tabs instead of spaces and its complaining on every line. I want to exclude the vendor directory from being checked.

benmatselby commented 9 years ago

@boboldehampsink Is this when running the sniffer over an entire folder? If so, not at present, but happy to accept a PR

boboldehampsink commented 9 years ago

No, this is when I go into the vendor folder and open any (non-compliant) file there. I just want this checker to skip any given exclusions by folder.

benmatselby commented 9 years ago

@boboldehampsink Sorry, that isn't something it does at the moment, as that would need more config above the config passed over to phpcs. I guess you are running this on save or something and you are making changes in the vendor dir?

boboldehampsink commented 9 years ago

Nahh, its just that I'm looking at files in the vendor dir (never change anything there ;-)) - and every line gets a red dot for not being compliant. It bugs me.

benmatselby commented 9 years ago

Unless you execute the plugin or have it configured to run on save I'm not sure how it's producing error reports on the files you mention. Can you paste your config in here please and the console output.

Sent from my iPhone

On 25 Feb 2015, at 12:58, Bob Olde Hampsink notifications@github.com wrote:

Nahh, its just that I'm looking at files in the vendor dir (never change anything there ;-)) - and every line gets a red dot for not being compliant. It bugs me.

— Reply to this email directly or view it on GitHub.