Merge pull request #1298 from danielbrodin/use-local-phpcs-settings

Use local phpcs config file if available.
This commit is contained in:
Glavin Wiechert 2017-04-15 01:41:22 -03:00 committed by GitHub
commit 92b774b7c5
3 changed files with 9 additions and 1 deletions

View File

@ -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"

View File

@ -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

View File

@ -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."
}