Skip to content

Commit e74f2bc

Browse files
committed
fix issue #86
1 parent 7cee5d9 commit e74f2bc

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gulp-scss-lint",
33
"description": "Validate `.scss` files with `scss-lint`",
4-
"version": "0.7.2",
4+
"version": "1.0.0",
55
"homepage": "http://github.com/juanfran/gulp-scss-lint",
66
"repository": "git://github.com/juanfran/gulp-scss-lint.git",
77
"main": "./src/index.js",

src/scss-lint.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,17 @@ module.exports = function(stream, files, options) {
170170
if (options.src) {
171171
var paths = Object.keys(report);
172172

173-
getVinylFiles(paths).then(function(vinylFiles) {
174-
reportLint(stream, vinylFiles, options, report, xmlReport);
175-
resolve();
176-
});
173+
if (paths.length) {
174+
getVinylFiles(paths).then(function(vinylFiles) {
175+
reportLint(stream, vinylFiles, options, report, xmlReport);
176+
resolve();
177+
});
178+
} else {
179+
getVinylFiles(files).then(function(vinylFiles) {
180+
reportLint(stream, vinylFiles, options, report, xmlReport);
181+
resolve();
182+
});
183+
}
177184
} else {
178185
try {
179186
reportLint(stream, files, options, report, xmlReport);

test/main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@ describe('gulp-scss-lint', function() {
266266
stream.end();
267267
});
268268

269+
it('scss-lint src success', function(done) {
270+
var stream = scssLintPlugin({src: 'test/fixtures/valid.scss'});
271+
272+
stream
273+
.on('data', function (file) {
274+
expect(file.scsslint.success).to.be.true;
275+
})
276+
.once('end', function() {
277+
done();
278+
});
279+
});
280+
269281
it('valid xml pipe output', function(done) {
270282
var fakeFile = getFixtureFile('valid.scss');
271283
var stream = scssLintPlugin({"filePipeOutput": "test.xml", 'reporterOutputFormat': 'Checkstyle'});

0 commit comments

Comments
 (0)