Merge pull request #1298 from danielbrodin/use-local-phpcs-settings
Use local phpcs config file if available.
This commit is contained in:
commit
92b774b7c5
|
@ -115,6 +115,10 @@
|
|||
"name": "Victor Uriarte",
|
||||
"url": "https://github.com/vmuriart"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Brodin",
|
||||
"url": "https://github.com/danielbrodin"
|
||||
},
|
||||
{
|
||||
"name": "Anton Brok-Volchansky",
|
||||
"url": "https://github.com/re6exp"
|
||||
|
|
|
@ -21,6 +21,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
|
||||
|
|
|
@ -44,6 +44,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