Comments (10)
Thanks for your feedback!
How do you run the gulpfile to get the exit code?
I've tried this and I get 1
var spawn = require('child_process').spawn,
lint = spawn('gulp', ['lint']);
lint.on('close', function (code) {
console.log('child process exited with code ' + code);
});
from gulp-scss-lint.
Hi juanfran,
File: hooks/before_prepare/010_gulp-scss-lint.js
#!/usr/bin/env node
var lint = require('gulp-scss-lint');
var gulp = require('gulp');
gulp.task('lint', function() {
return gulp.src('./src/scss/**/*.scss')
.pipe(lint())
.pipe(lint.failReporter());
});
gulp.start('lint');
Shell-Command
> nodejs hooks/before_prepare/010_gulp-scss-lint.js
It reports the error in my scss-file, then I check the exit-code that gets passed to the shell via
> echo $?
which is 0, even on error. This procedure does work with gulp-css-lint, eg. this is the script for css linting:
#!/usr/bin/env node
var lint = require('gulp-jshint');
var gulp = require('gulp');
gulp.task('lint', function() {
return gulp.src('./src/js/**/*.js')
.pipe(lint())
.pipe(lint.reporter('jshint-stylish'))
.pipe(lint.reporter('fail'));
});
gulp.start('lint');
from gulp-scss-lint.
I did some more investigation on running gulp directly, with
> gulp --gulpfile hooks/before_prepare/010_gulp-scss-lint.js lint
I do get the correct exit-code (1 on error/warning) on the shell, once I make gulp.src(...) relative to the gulpfile.
This does seem strange though, since I can invoke all other linters (gulp-csslint, gulp-htmlhint, gulp-jshint) using gulp as node module.
from gulp-scss-lint.
I think that I've found the problem but It's very strange and I don't know exactly why... sorry but maybe It will take me some days
from gulp-scss-lint.
Thanks for taking the time.
from gulp-scss-lint.
sorry for the delay, could you try with the 0.3.8 version? thanks
from gulp-scss-lint.
Updated to version 0.3.8, but still the same, I'll add the full output maybe this helps:
$ node hooks/before_prepare/010_gulp-scss-lint.js
[08:34:55] 1 issues found in /home/hufschmt/Workspace/WebView/mILIAS/src/scss/ionic.app.scss
[08:34:55] ionic.app.scss:43 [E] Syntax Error: Invalid CSS after "...nic/scss/ionic'": expected "{", was ";"
Unhandled rejection Error in plugin 'gulp-scss-lint'
Message:
ScssLint failed for: ionic.app.scss
$ echo $?
0
and
$ gulp --gulpfile hooks/before_prepare/010_gulp-scss-lint.js lint
[08:39:46] Working directory changed to ~/Workspace/WebView/mILIAS/hooks/before_prepare
[08:39:46] Using gulpfile ~/Workspace/WebView/mILIAS/hooks/before_prepare/010_gulp-scss-lint.js
[08:39:46] Starting 'lint'...
[08:39:47] 1 issues found in /home/hufschmt/Workspace/WebView/mILIAS/src/scss/ionic.app.scss
[08:39:47] ionic.app.scss:43 [E] Syntax Error: Invalid CSS after "...nic/scss/ionic'": expected "{", was ";"
[08:39:47] 'lint' errored after 266 ms
[08:39:47] Error in plugin 'gulp-scss-lint'
Message:
ScssLint failed for: ionic.app.scss
$ echo $?
1
from gulp-scss-lint.
I've test this issue with this https://github.com/juanfran/gulp-scss-lint-test-error before the 0.3.8 I had the wrong exit code, but now works well for me, could you try with this repo and tell me what is different?
thank you!
from gulp-scss-lint.
TL;DR: I tested your example and it works, my issue is resolved. 😄
Details:
Extracting your example to a random folder worked both via calling gulp and as node module.
I tried figuring out why this didn't seem to work with my code and copied piece by piece of your example into my working directory, which caused even your example to fail (again).
After this it was clear that something in my working dir was wrong, so I removed all node_modules and reinstalled them with npm install
, which low and behold fixed your example (copied into my project folder) and my project...
So my guess is, although I did update via npm install gulp-scss-lint
and even checked version under node_modules/gulp-scss-lint/packages.json
, something must have gone wrong, the problem is fixed in 0.3.8.
I'll leave the pleasure of closing this issue to you. 😄
from gulp-scss-lint.
😄 thanks!
from gulp-scss-lint.
Related Issues (20)
- newKey is not defined HOT 2
- error indicates scss-lint not installed, but it is HOT 1
- bundle exec version says Unexpected token T HOT 3
- failReporter and gulp.watch don't work together HOT 7
- Upgrade vinyl-fs dependency to ^2.4.0 HOT 1
- Support for JUnit as output format
- Display message when no error was found HOT 2
- Generic error when the gem is not installed HOT 5
- Fatal Undefined Error HOT 4
- command prompt The input line is too long. HOT 2
- Input file did not exist or was not readable HOT 1
- Command line usage error - XML Format HOT 1
- No such file or directory error in macOS High Sierra HOT 4
- Drop dependency on deprecated "gulp-util"
- gulp-util is deprecated HOT 1
- Unhandled rejection Error: Invalid glob argument thrown when src option used HOT 1
- [Error] 'scss-lint' is not recognized as an internal or external command HOT 3
- Depends on compromised package "event-stream" HOT 5
- scss-lint returns undefined when there aren't errors in files HOT 2
- "OS Command Injection" critical alert
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-scss-lint.