diff --git a/package.json b/package.json index 134194e..4dabdbc 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/beautifiers/phpcbf.coffee b/src/beautifiers/phpcbf.coffee index 0b0db2e..935a18d 100644 --- a/src/beautifiers/phpcbf.coffee +++ b/src/beautifiers/phpcbf.coffee @@ -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 diff --git a/src/languages/php.coffee b/src/languages/php.coffee index ef8eade..43a287a 100644 --- a/src/languages/php.coffee +++ b/src/languages/php.coffee @@ -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." }