Skip to content

Commit bbb75d4

Browse files
author
Phil Hughes
committed
Make CLI output link to the wiki
Closes twbs#102 Closes twbs#130
1 parent fb197d7 commit bbb75d4

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

dist/browser/bootlint.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9878,6 +9878,7 @@ var cheerio = require('cheerio');
98789878
*/
98799879
exports.showLintReportForCurrentDocument = function (disabledIds) {
98809880
var seenLint = false;
9881+
var errorCount = 0;
98819882
var reporter = function (lint) {
98829883
var background = "background: #" + (lint.id[0] === "W" ? "f0ad4e" : "d9534f") + "; color: #ffffff;";
98839884
if (!seenLint) {
@@ -9887,8 +9888,13 @@ var cheerio = require('cheerio');
98879888
seenLint = true;
98889889
}
98899890
console.warn("bootlint: %c " + lint.id + " ", background, lint.message);
9891+
errorCount++;
98909892
};
98919893
this.lintCurrentDocument(reporter, disabledIds);
9894+
9895+
if (errorCount > 0) {
9896+
console.log("For details, look up the lint problem IDs in the Bootlint wiki: https://github.com/twbs/bootlint/wiki");
9897+
}
98929898
};
98939899
/*eslint-disable no-undef, block-scoped-var */
98949900
window.bootlint = exports;

src/bootlint.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ var cheerio = require('cheerio');
678678
*/
679679
exports.showLintReportForCurrentDocument = function (disabledIds) {
680680
var seenLint = false;
681+
var errorCount = 0;
681682
var reporter = function (lint) {
682683
var background = "background: #" + (lint.id[0] === "W" ? "f0ad4e" : "d9534f") + "; color: #ffffff;";
683684
if (!seenLint) {
@@ -687,8 +688,13 @@ var cheerio = require('cheerio');
687688
seenLint = true;
688689
}
689690
console.warn("bootlint: %c " + lint.id + " ", background, lint.message);
691+
errorCount++;
690692
};
691693
this.lintCurrentDocument(reporter, disabledIds);
694+
695+
if (errorCount > 0) {
696+
console.log("For details, look up the lint problem IDs in the Bootlint wiki: https://github.com/twbs/bootlint/wiki");
697+
}
692698
};
693699
/*eslint-disable no-undef, block-scoped-var */
694700
window.bootlint = exports;

src/cli.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ patterns.forEach(function (pattern) {
3535
});
3636
});
3737

38+
console.log("");
39+
40+
if (totalErrCount > 0) {
41+
console.log("For details, look up the lint problem IDs in the Bootlint wiki: https://github.com/twbs/bootlint/wiki");
42+
}
43+
3844
console.log("" + totalErrCount + " lint error(s) found across " + totalFileCount + " file(s).");
3945
if (totalErrCount) {
4046
process.exit(1);

0 commit comments

Comments
 (0)