-
Notifications
You must be signed in to change notification settings - Fork 34
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
failReporter and gulp.watch don't work together #67
Comments
sorry for waiting. why do you need |
Thats what I want it to do. If there are errors during linting, the task should fail so you are forced to fix them before recompiling. But if everything is ok, the task should continue like usual. Isn't that how you use failReporter? |
I can't reproduce it, sorry. Are you getting any message on the first execution? |
I ran into the same issue and ended up writing a custom report function to set the function scsslint() {
return gulp.src(paths, {
since: gulp.lastRun('scsslint')
})
.pipe(pi.scssLint({
config: 'gulp/.scss-lint.yml',
customReport: (file) => {
var colors = pi.util.colors;
if (!file.scsslint.success) {
process.exitCode = 1;
pi.util.log(
colors.cyan(file.scsslint.issues.length) +
' issues found in ' +
colors.magenta(file.path)
);
file.scsslint.issues.forEach((issue) => {
var severity = issue.severity === 'warning' ? colors.yellow(' [W] ') : colors.red(' [E] ');
var linter = issue.linter ? (`${issue.linter}: `) : '';
var logMsg = `${colors.cyan(file.relative)}:` +
colors.magenta(issue.line) +
severity +
colors.green(linter) +
issue.reason;
pi.util.log(logMsg);
});
}
}
}));
} gulp.task('styles:watch', () => {
gulp.watch(paths, options)
.on('change', gulp.series(
scsslint,
// other tasks
));
}); |
I've made a simple example of what I've tried https://github.com/juanfran/gulp-scss-lint/tree/test-bug/test-bug |
I tried your example and don't run into the situation there. Maybe it's caused in combination with one of the other plugins. I'll try to isolate it and provide feedback, if I find something. @dak If I understand you correctly, your change is based on the situation where errors do happen? Because I get no further execution after the first successfull run. |
@ehaeusler It should continue to run even if warnings/errors are thrown (it won't stop the next tests from being run either). But if you're using any kind of continuous integration (like Travis CI), it will properly signal to that environment that the test failed (and if you integrate it with GitHub, can allow you to prevent merging commits with errors). |
Hi there,
In my current setup (Gulp 4.0.0-alpha.2) gulp.watch stops working after the first execution if I use failReporter. The task runs successfully, but further changes don't trigger another task. Without the failReporter, the watcher works. I even tried it with the endless option, but that prevents the task from executing entirely (Shell output stops at "Starting 'styles'....).
My gulpfile:
The text was updated successfully, but these errors were encountered: