Add rules option

Merged fixers and level options
This commit is contained in:
onigra 2017-02-11 21:53:35 +09:00
parent 1731401306
commit 42cc955930
2 changed files with 3 additions and 8 deletions

View File

@ -20,8 +20,7 @@ module.exports = class PHPCSFixer extends Beautifier
configFile = if context? and context.filePath? then @findFile(path.dirname(context.filePath), '.php_cs')
phpCsFixerOptions = [
"fix"
"--level=#{options.level}" if options.level
"--fixers=#{options.fixers}" if options.fixers
"--rules=#{options.rules}" if options.rules
"--config-file=#{configFile}" if configFile
]
runOptions = {

View File

@ -27,14 +27,10 @@ module.exports = {
type: 'string'
default: ""
description: "Path to the `php-cs-fixer` CLI executable"
fixers:
rules:
type: 'string'
default: ""
description: "Add fixer(s). i.e. linefeed,-short_tag,indentation"
level:
type: 'string'
default: ""
description: "By default, all PSR-2 fixers and some additional ones are run."
description: "Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'