boolean shouldCheckConformanceFor ( String filePath ) { for ( String whitelistedPath : getWhitelistedPaths ( ) ) { if ( filePath . contains ( whitelistedPath ) ) { return false ; } } ImmutableList < String > onlyApplyToPaths = getOnlyApplyToPaths ( ) ; if ( onlyApplyToPaths . isEmpty ( ) ) { return true ; } // If only_apply_to field is presented in the configuration, check it. for ( String onlyApplyToPath : onlyApplyToPaths ) { if ( filePath . contains ( onlyApplyToPath ) ) { return true ; } } return false ; }
A file should be checked against a rule unless it contains one of the whitelisted paths .