Skip to content

Commit dbf51b1

Browse files
committed
Output the offending found string
1 parent f676dfb commit dbf51b1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ var fixmeStrings = "'FIXME|TODO|HACK|BUG'";
99

1010
// Prints properly structured Issue data to STDOUT according to
1111
// Code Climate Engine specification.
12-
var printIssue = function(fileName, lineNum){
12+
var printIssue = function(fileName, lineNum, issue){
1313
var issue = {
1414
"type": "issue",
1515
"check_name": "FIXME found",
16-
"description": "Code comment found that needs your attention.",
16+
"description": issue + " found",
1717
"categories": ["Bug Risk"],
1818
"location":{
1919
"path": fileName,
@@ -31,7 +31,7 @@ var printIssue = function(fileName, lineNum){
3131

3232
var findFixmes = function(file){
3333
// Prepare the grep string for execution (uses BusyBox grep)
34-
var grepString = "grep -inH -E " + fixmeStrings + " " + file;
34+
var grepString = "grep -inHo -E " + fixmeStrings + " " + file;
3535

3636
// Execute grep with the FIXME patterns
3737
exec(grepString, function(error, stdout, stderr) {
@@ -48,8 +48,9 @@ var findFixmes = function(file){
4848
// Remove remnants of container paths for external display
4949
var fileName = cols[0].split("/code/")[1];
5050
var lineNum = cols[1];
51-
52-
printIssue(fileName, lineNum);
51+
var issue = cols[2];
52+
53+
printIssue(fileName, lineNum, issue);
5354
}
5455
})
5556
})

0 commit comments

Comments
 (0)