klei / gulp-angular-filesort

Automatically sort AngularJS app files depending on module definitions and usage
MIT License
132 stars 46 forks source link

Processing should not fail for a single parsing error #19

Open Toilal opened 9 years ago

Toilal commented 9 years ago

https://github.com/klei/gulp-angular-filesort/blob/master/index.js#L24

Does this make sense to through this error instead of continuing ? If there is about 100 javascript files to sort, why breaking the whole processing just because of one file ?

zckrs commented 9 years ago

@joakimbeng do you have a opinion on that ? :smiley:

joakimbeng commented 9 years ago

Sorry for my slow response :P

I think you're right. Do you think it should log anything when a syntax error is found, or be totally quiet?

zckrs commented 9 years ago

In my opinion a gulp plugin shloud parse argv to catch the --verbose option of cli cmd gulp. Like https://github.com/zckrs/gulp-css-base64/blob/master/src/index.js#L31 See comment

Toilal commented 9 years ago

I'm not sure it should depend on --verbose flag because it's an error. It should be logged maybe at warning level.

ricolo commented 9 years ago

Here's the handling of the same issue in gulp-sass by passing in an option {errLogToConsole: true}: http://blog.ionic.io/fixing-a-broken-sass-build-stream/

pedroassis commented 8 years ago

Came across a issue where if you try to sort a stream of files where you have both your js and css the lib will fail silently.

Example: gulp.src(['./src/**/*.js', './src/**/*.css'], {read: false});

I don't think it should even fail, don't parse non js files.