Use local phpcs config file if available.
This commit is contained in:
parent
55dad2903e
commit
85d0f19e37
|
@ -114,6 +114,10 @@
|
|||
{
|
||||
"name": "Victor Uriarte",
|
||||
"url": "https://github.com/vmuriart"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Brodin",
|
||||
"url": "https://github.com/danielbrodin"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
|
@ -301,4 +305,4 @@
|
|||
"lint": "coffeelint src/ spec/",
|
||||
"code-docs": "codo && open docs/code/index.html"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,10 @@ module.exports = class PHPCBF extends Beautifier
|
|||
|
||||
beautify: (text, language, options) ->
|
||||
@debug('phpcbf', options)
|
||||
standardFiles = ['phpcs.xml', 'phpcs.xml.dist', 'phpcs.ruleset.xml', 'ruleset.xml']
|
||||
standardFile = @findFile(atom.project.getPaths()[0], standardFiles);
|
||||
|
||||
options.standard = standardFile if standardFile
|
||||
|
||||
isWin = @isWindows
|
||||
if isWin
|
||||
|
|
|
@ -42,6 +42,6 @@ module.exports = {
|
|||
title: "PHPCBF Standard"
|
||||
type: 'string'
|
||||
default: "",
|
||||
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules"
|
||||
description: "Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules. Will use local `phpcs.xml`, `phpcs.xml.dist`, `phpcs.ruleset.xml` or `ruleset.xml` if found in the project root."
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue