DRY @run options
This commit is contained in:
parent
87ed01e7be
commit
bf7586c858
|
@ -18,6 +18,12 @@ module.exports = class PHPCSFixer extends Beautifier
|
||||||
@debug('php-cs-fixer', options)
|
@debug('php-cs-fixer', options)
|
||||||
|
|
||||||
configFile = if context? and context.filePath? then @findFile(path.dirname(context.filePath), '.php_cs')
|
configFile = if context? and context.filePath? then @findFile(path.dirname(context.filePath), '.php_cs')
|
||||||
|
runOptions = {
|
||||||
|
ignoreReturnCode: true
|
||||||
|
help: {
|
||||||
|
link: "https://github.com/FriendsOfPHP/PHP-CS-Fixer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Find php-cs-fixer.phar script
|
# Find php-cs-fixer.phar script
|
||||||
@Promise.all([
|
@Promise.all([
|
||||||
|
@ -42,12 +48,7 @@ module.exports = class PHPCSFixer extends Beautifier
|
||||||
"--fixers=#{options.fixers}" if options.fixers
|
"--fixers=#{options.fixers}" if options.fixers
|
||||||
"--config-file=#{configFile}" if configFile
|
"--config-file=#{configFile}" if configFile
|
||||||
tempFile = @tempFile("temp", text)
|
tempFile = @tempFile("temp", text)
|
||||||
], {
|
], runOptions)
|
||||||
ignoreReturnCode: true
|
|
||||||
help: {
|
|
||||||
link: "https://github.com/FriendsOfPHP/PHP-CS-Fixer"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(=>
|
.then(=>
|
||||||
@readFile(tempFile)
|
@readFile(tempFile)
|
||||||
)
|
)
|
||||||
|
@ -58,12 +59,7 @@ module.exports = class PHPCSFixer extends Beautifier
|
||||||
"--fixers=#{options.fixers}" if options.fixers
|
"--fixers=#{options.fixers}" if options.fixers
|
||||||
"--config-file=#{configFile}" if configFile
|
"--config-file=#{configFile}" if configFile
|
||||||
tempFile = @tempFile("temp", text)
|
tempFile = @tempFile("temp", text)
|
||||||
], {
|
], runOptions)
|
||||||
ignoreReturnCode: true
|
|
||||||
help: {
|
|
||||||
link: "https://github.com/FriendsOfPHP/PHP-CS-Fixer"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(=>
|
.then(=>
|
||||||
@readFile(tempFile)
|
@readFile(tempFile)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue