Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node_modules to filename checks #9

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

Don’t scan into `node_modules` or `.sass-cache` folders, but keep the…

… top-level folder so we can trigger warnings in the Filenames check.
  • Loading branch information
ryelle committed Nov 10, 2014
commit 64402b1586bee4a87a0afdf7dfee913958068168
@@ -19,13 +19,21 @@ function check_main( $theme ) {

if ( $files ) {
foreach( $files as $key => $filename ) {
// Ignore . and .. files.
// Don't scan into node_modules or .sass-cache
if ( ( basename( $filename ) == '..' )
|| ( basename( $filename ) == '.' )
|| preg_match( '/node_modules\/.+/i', $filename )
|| preg_match( '/\.sass-cache\/.+/i', $filename )
){
continue;
}

if ( substr( $filename, -4 ) == '.php' ) {
$php[$filename] = php_strip_whitespace( $filename );
}
else if ( substr( $filename, -4 ) == '.css' ) {
} else if ( substr( $filename, -4 ) == '.css' ) {
$css[$filename] = file_get_contents( $filename );
}
else {
} else {
$other[$filename] = ( ! is_dir($filename) ) ? file_get_contents( $filename ) : '';
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.