Automattic / vip-scanner

Deprecated: Scan all sorts of themes and files and things! Use PHPCS and the VIP coding standards instead
https://automattic.com
140 stars 51 forks source link

Standard way of indicating skipped directories #134

Open danielbachhuber opened 10 years ago

danielbachhuber commented 10 years ago

VIP Scanner gets pretty useless when it scans /node_modules, etc.

There should be a standard way of marking files / directories to skip in the scan.

developdaly commented 10 years ago

I'm guessing this is why the scanner never works locally for me.

grappler commented 10 years ago

@joshbetz What do you think?

grappler commented 10 years ago

The PR #149 is only solving the problem temporarily. What about adding a filter so that it can be defined according to the environment?

danielbachhuber commented 10 years ago

Can we leave this open? .sass-cache is another such directory, and I don't think you want to play whack-a-mole with excluded directories.

danielbachhuber commented 10 years ago

Also, you have the directories individually declared multiple times — that's ripe for abstraction.

nickdaugherty commented 10 years ago

Yes this should remain open - the PR incorrectly mentioned fixing this issue, but it only adds node_modules to the excluded list.

grappler commented 10 years ago

I have have tried to create a version where a filter is used: https://github.com/grappler/vip-scanner/commit/27db1a3dc995d54784087e0eb39ab398879e3cc0

I am getting an error with my current code. Parse error: syntax error, unexpected '(', expecting ',' or ';' in /wp-content/plugins/vip-scanner/vip-scanner/class-base-check.php on line 8

I would love some feedback.

joshbetz commented 10 years ago

I am getting an error with my current code. Parse error: syntax error, unexpected '(', expecting ',' or ';' in /wp-content/plugins/vip-scanner/vip-scanner/class-base-check.php on line 8

You can't call a function in that context. The filter would have to go in a constructor.