From 93ac2a03eee6e27c3594050dfe56347bb8244a9d Mon Sep 17 00:00:00 2001 From: Jonid Bendo Date: Thu, 20 Apr 2017 17:35:38 +0200 Subject: [PATCH 1/7] added allow-risky --- src/beautifiers/php-cs-fixer.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/beautifiers/php-cs-fixer.coffee b/src/beautifiers/php-cs-fixer.coffee index d6760610e..8176a2eff 100644 --- a/src/beautifiers/php-cs-fixer.coffee +++ b/src/beautifiers/php-cs-fixer.coffee @@ -24,6 +24,7 @@ module.exports = class PHPCSFixer extends Beautifier "fix" "--rules=#{options.rules}" if options.rules "--config=#{configFile}" if configFile + "--allow-risky=#{options.allowRisky}" if options.allowRisky "--using-cache=no" ] if version is 1 From b57e5acba3b2f8b7629f438d402176ef7babbfe3 Mon Sep 17 00:00:00 2001 From: Jonid Bendo Date: Thu, 20 Apr 2017 17:42:55 +0200 Subject: [PATCH 2/7] Update php-cs-fixer.coffee --- src/beautifiers/php-cs-fixer.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beautifiers/php-cs-fixer.coffee b/src/beautifiers/php-cs-fixer.coffee index 8176a2eff..fd420815b 100644 --- a/src/beautifiers/php-cs-fixer.coffee +++ b/src/beautifiers/php-cs-fixer.coffee @@ -24,7 +24,7 @@ module.exports = class PHPCSFixer extends Beautifier "fix" "--rules=#{options.rules}" if options.rules "--config=#{configFile}" if configFile - "--allow-risky=#{options.allowRisky}" if options.allowRisky + "--allow-risky=#{options.allow_risky}" if options.allow_risky "--using-cache=no" ] if version is 1 From 907ca37a49cc1aaa0ba3eedad0d1c82fe26cf22e Mon Sep 17 00:00:00 2001 From: Jonid Bendo Date: Thu, 20 Apr 2017 17:45:53 +0200 Subject: [PATCH 3/7] added option added option for risky rules --- src/options.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/options.json b/src/options.json index cdcce930b..a61c4fbd6 100644 --- a/src/options.json +++ b/src/options.json @@ -5852,6 +5852,24 @@ "namespace": "php" } }, + "allow_risky": { + "title": "Allow risky rules", + "type": "string", + "default": "no", + "enum": [ + "no", + "yes" + ], + "beautifiers": [ + "PHP-CS-Fixer" + ], + "key": "allow_risky", + "language": { + "name": "PHP", + "namespace": "php" + }, + "description": "allow risky rules to be applied!" + }, "phpcbf_path": { "title": "PHPCBF Path", "type": "string", @@ -9040,4 +9058,4 @@ } } } -} \ No newline at end of file +} From 3655f2e4f962434a4f74d3c99dd71b52df4e3ef7 Mon Sep 17 00:00:00 2001 From: Jonid Bendo Date: Thu, 20 Apr 2017 18:17:30 +0200 Subject: [PATCH 4/7] Update options.json From 6f2354d375b2ff5846b9f2f0744bb9e48fc3aa61 Mon Sep 17 00:00:00 2001 From: Jonid Bendo Date: Fri, 21 Apr 2017 15:29:44 +0200 Subject: [PATCH 5/7] added option to language --- src/languages/php.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/languages/php.coffee b/src/languages/php.coffee index 6cb32f15a..adc40909e 100644 --- a/src/languages/php.coffee +++ b/src/languages/php.coffee @@ -44,6 +44,12 @@ module.exports = { type: 'string' default: "" description: "Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2 (PHP-CS-Fixer 2 only)" + allow_risky: + title: "Allow risky rules" + type: 'string' + default: "no" + enum: ["no", "yes"] + description: "allow risky rules to be applied!" phpcbf_path: title: "PHPCBF Path" type: 'string' From 267082dc3364587bbdc35811fc4ccc8716e461f1 Mon Sep 17 00:00:00 2001 From: Jonid Bendo Date: Fri, 21 Apr 2017 16:07:32 +0200 Subject: [PATCH 6/7] autogenerated files --- docs/options.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ src/options.json | 6 ++--- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/docs/options.md b/docs/options.md index f8a5bc6a9..cce9b1e32 100644 --- a/docs/options.md +++ b/docs/options.md @@ -9570,6 +9570,7 @@ Specify a configuration file which will override the default name of .perltidyrc | `disabled` | :white_check_mark: | :white_check_mark: | :white_check_mark: | | `default_beautifier` | :white_check_mark: | :white_check_mark: | :white_check_mark: | | `beautify_on_save` | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| `allow_risky` | :white_check_mark: | :x: | :x: | | `cs_fixer_path` | :white_check_mark: | :x: | :x: | | `cs_fixer_version` | :white_check_mark: | :x: | :x: | | `fixers` | :white_check_mark: | :x: | :x: | @@ -9637,6 +9638,34 @@ Automatically beautify PHP files on save 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*Beautify On Save*" and change it to your desired configuration. +##### [Allow risky rules](#allow-risky-rules) + +**Namespace**: `php` + +**Key**: `allow_risky` + +**Default**: `no` + +**Type**: `string` + +**Enum**: `no` `yes` + +**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer) + +**Description**: + +allow risky rules to be applied! (Supported by PHP-CS-Fixer) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "php": { + "allow_risky": "no" + } +} +``` + ##### [PHP-CS-Fixer Path](#php-cs-fixer-path) **Namespace**: `php` @@ -17421,6 +17450,34 @@ Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2 (PHP-CS-Fixer 2 only) (Sup } ``` +##### [Allow risky rules](#allow-risky-rules) + +**Namespace**: `php` + +**Key**: `allow_risky` + +**Default**: `no` + +**Type**: `string` + +**Enum**: `no` `yes` + +**Supported Beautifiers**: [`PHP-CS-Fixer`](#php-cs-fixer) + +**Description**: + +allow risky rules to be applied! (Supported by PHP-CS-Fixer) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "php": { + "allow_risky": "no" + } +} +``` + ##### [PHPCBF Path](#phpcbf-path) **Namespace**: `php` diff --git a/src/options.json b/src/options.json index a61c4fbd6..213bbbe50 100644 --- a/src/options.json +++ b/src/options.json @@ -5860,6 +5860,7 @@ "no", "yes" ], + "description": "allow risky rules to be applied! (Supported by PHP-CS-Fixer)", "beautifiers": [ "PHP-CS-Fixer" ], @@ -5867,8 +5868,7 @@ "language": { "name": "PHP", "namespace": "php" - }, - "description": "allow risky rules to be applied!" + } }, "phpcbf_path": { "title": "PHPCBF Path", @@ -9058,4 +9058,4 @@ } } } -} +} \ No newline at end of file From 449d95b2ad39c1b5122f884e359844d2166643e0 Mon Sep 17 00:00:00 2001 From: Jonid Bendo Date: Fri, 21 Apr 2017 16:44:53 +0200 Subject: [PATCH 7/7] added v2-clarification in desc --- docs/options.md | 4 ++-- src/languages/php.coffee | 2 +- src/options.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/options.md b/docs/options.md index cce9b1e32..c4e0a381b 100644 --- a/docs/options.md +++ b/docs/options.md @@ -9654,7 +9654,7 @@ Automatically beautify PHP files on save **Description**: -allow risky rules to be applied! (Supported by PHP-CS-Fixer) +allow risky rules to be applied (PHP-CS-Fixer 2 only) (Supported by PHP-CS-Fixer) **Example `.jsbeautifyrc` Configuration** @@ -17466,7 +17466,7 @@ Add rule(s). i.e. line_ending,-full_opening_tag,@PSR2 (PHP-CS-Fixer 2 only) (Sup **Description**: -allow risky rules to be applied! (Supported by PHP-CS-Fixer) +allow risky rules to be applied (PHP-CS-Fixer 2 only) (Supported by PHP-CS-Fixer) **Example `.jsbeautifyrc` Configuration** diff --git a/src/languages/php.coffee b/src/languages/php.coffee index adc40909e..42274f8fe 100644 --- a/src/languages/php.coffee +++ b/src/languages/php.coffee @@ -49,7 +49,7 @@ module.exports = { type: 'string' default: "no" enum: ["no", "yes"] - description: "allow risky rules to be applied!" + description: "allow risky rules to be applied (PHP-CS-Fixer 2 only)" phpcbf_path: title: "PHPCBF Path" type: 'string' diff --git a/src/options.json b/src/options.json index 213bbbe50..e7894a9a1 100644 --- a/src/options.json +++ b/src/options.json @@ -5860,7 +5860,7 @@ "no", "yes" ], - "description": "allow risky rules to be applied! (Supported by PHP-CS-Fixer)", + "description": "allow risky rules to be applied (PHP-CS-Fixer 2 only) (Supported by PHP-CS-Fixer)", "beautifiers": [ "PHP-CS-Fixer" ],