Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,17 @@ Increase the verbosity of messages.
- 2 for more verbose output
- 3 for debug

#### reportFile
Type: `String`
Default: `undefined`

Write result to file instead of stdout.

#### maxBuffer
Type: `Number`
Default: `200*1024`

Override the maxBuffer-Size of nodejs's exec() function if you expect a long output on stdout.

---
Inspired by [grunt-phpmd](https://github.com/alappe/grunt-phpmd)
Inspired by [grunt-phpmd](https://github.com/alappe/grunt-phpmd)
5 changes: 4 additions & 1 deletion tasks/lib/phpdcd.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exports.init = (grunt) ->
##3 for debug
verbose: false
noInteraction: true
reportFile: undefined
maxBuffer: 200*1024

buildCommand = (dirs) ->
Expand Down Expand Up @@ -57,7 +58,9 @@ exports.init = (grunt) ->
exports.run = ->
cmdOptions = maxBuffer: config.maxBuffer
exec cmd, cmdOptions, (err, stdout, stderr) ->
grunt.log.write stdout if stdout
if config.reportFile
grunt.file.write(config.reportFile, stdout)
else grunt.log.write stdout if stdout

# As documented on # http://phpmd.org/documentation/index.html#exit-codes
grunt.fatal stdout if err and err.code isnt 2
Expand Down