2014-08-10 15:51:44 -06:00
|
|
|
###
|
|
|
|
Requires https://github.com/hhatto/autopep8
|
|
|
|
###
|
|
|
|
getCmd = (inputPath, outputPath, options) ->
|
|
|
|
path = options.autopep8_path # jshint ignore: line
|
|
|
|
# jshint ignore: line
|
|
|
|
# jshint ignore: line
|
2014-12-27 23:22:44 -07:00
|
|
|
optionsStr = ""
|
|
|
|
if options.max_line_length?
|
|
|
|
optionsStr += "--max-line-length #{options.max_line_length}"
|
|
|
|
if options.indent_size?
|
|
|
|
optionsStr += " --indent-size #{options.indent_size}"
|
|
|
|
if options.ignore?
|
|
|
|
optionsStr += " --ignore " + options.ignore.join(",") # jshint ignore: line
|
2014-08-10 15:51:44 -06:00
|
|
|
if path
|
|
|
|
# Use absolute path
|
2014-09-28 13:33:23 -06:00
|
|
|
"#{path} \"#{inputPath}\" #{optionsStr}"
|
2014-08-10 15:51:44 -06:00
|
|
|
else
|
|
|
|
# Use command available in $PATH
|
2014-12-27 23:22:44 -07:00
|
|
|
"autopep8 \"#{inputPath}\" #{optionsStr}"
|
2014-08-10 15:51:44 -06:00
|
|
|
"use strict"
|
|
|
|
cliBeautify = require("./cli-beautify")
|
|
|
|
isStdout = true
|
|
|
|
module.exports = cliBeautify(getCmd, isStdout)
|