juanfran / gulp-scss-lint

Gulp plugin to lint scss files with `scss-lint`
113 stars 33 forks source link

exclude option not working? #3

Closed escapedcat closed 10 years ago

escapedcat commented 10 years ago

I try to exclude a specific files from linting.

Using scss-lint this works:

scss-lint -e 'scss/foo*.scss' scss/*.scss

Using gulp-scss-lint this failes:

.pipe(scsslint({
  'config': 'lint-scss.yml',
  'exclude': './scss/_*.scss'
}))
/var/www/my-project/node_modules/gulp-scss-lint/index.js:51
            throw new gutil.PluginError(PLUGIN_NAME, scssLintCodes[error.code]
                  ^
[gulp] Error in plugin 'gulp-scss-lint': Input file did not exist or was not readable
    at /var/www/my-project/node_modules/gulp-scss-lint/index.js:51:19
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

Not sure if it's my mistake or the plugin itself.

juanfran commented 10 years ago

I think that doesn't work if the scsslint pipe receives any of the excluded scss files, example..

  gulp.src('scss/*.scss')
    .pipe(csslint({
      'exclude': './scss/_*.scss'
    }))

In the above code the plugin try to excute something like this

scss-lint ./scss/_styles.scss --exclude ./scss/_*.scss 

and this doesn't work.

You should do something like this

  gulp.src(['scss/*.scss', '!scss/_*.scss'])
    .pipe(csslint())

Ignore files in the gulp src instead of the plugin exclude option.

Anyway, I'll try to fix it because it's a very strange behavior, thanks

escapedcat commented 10 years ago

Ah, right, yes... d'oh! Thanks for explaining how gulp works m(

pkyeck commented 10 years ago

I ran into the same thing - only thing, I wanted to use the exclude property inside the config-yml. just FYI.

juanfran commented 10 years ago

Now throw this error when you add exclude option "You must use gulp src to exclude"