Skip to content

Commit

Permalink
Merge pull request #60 from DanPurdy/prepare-1-3-0
Browse files Browse the repository at this point in the history
Prepare 1.3.0
  • Loading branch information
DanPurdy authored Nov 7, 2016
2 parents b4dc3ae + 3512e0f commit 5eee8e9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# gulp-sass-lint Changelog

## v1.3.0

**November 7th, 2016**

**Fixes**

* Fixed an issue with a user config file being ignored
* Fixed an issue with a format options being ignored

**Updates**

* Updated the way you can output results files from gulp-sass-lint, check the [README.md](README.md) for more information
* Updated to sass-lint 1.10.0 which adds the ability to disable linters via source comments
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,29 @@ gulp.task('default', function () {
```
---

### sassLint.format()
### sassLint.format(writable)

Formats the results dependent on your config file or the options you provided to the sassLint task above. The default format is `stylish` but you can choose any of the others that SassLint provides, see the [docs](https://github.com/sasstools/sass-lint/blob/master/docs/options/formatter.md). You can also choose to output to a file from within the options you provide or your config file. See the [output-file docs](https://github.com/sasstools/sass-lint/blob/master/docs/options/output-file.md)
Formats the results dependent on your config file or the options you provided to the sassLint task above. The default format is `stylish` but you can choose any of the others that SassLint provides, see the [docs](https://github.com/sasstools/sass-lint/blob/master/docs/options/formatter.md).

You can also choose to output to a file from within the options you provide or your config file. See the [output-file docs](https://github.com/sasstools/sass-lint/blob/master/docs/options/output-file.md)

```javascript
gulp.task('lint_sass_jenkins', function () {
var file = fs.createWriteStream('reports/lint_sass.xml');
var stream = gulp.src('public/sass/**/*.scss')
.pipe(sassLint({
options: {
configFile: '.sass-lint.yml',
formatter: 'checkstyle'
}
}))
.pipe(sassLint.format(file));
stream.on('finish', function() {
file.end();
});
return stream;
});
```

---

Expand Down
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var sassLint = function (options) {
return compile;
}

sassLint.format = function () {
sassLint.format = function (writable) {
var compile = through.obj(function (file, encoding, cb) {
if (file.isNull()) {
return cb();
Expand All @@ -70,7 +70,13 @@ sassLint.format = function () {
return cb();
}

lint.outputResults(file.sassLint, file.userOptions);
if (writable) {
var result = lint.format(file.sassLint, file.userOptions, file.configFile);
writable.write(result);
}
else {
lint.outputResults(file.sassLint, file.userOptions, file.configFile);
}

this.push(file);
cb();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-sass-lint",
"version": "1.2.0",
"version": "1.3.0",
"description": "Gulp plugin for Sass Lint",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 5eee8e9

Please sign in to comment.