Skip to content

Commit

Permalink
Merge pull request #1614 from JonidBendo/master
Browse files Browse the repository at this point in the history
php-cs-fixer allow risky option
  • Loading branch information
Glavin001 authored Apr 21, 2017
2 parents f82cbc3 + 449d95b commit 8ae9669
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
57 changes: 57 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 (PHP-CS-Fixer 2 only) (Supported by PHP-CS-Fixer)

**Example `.jsbeautifyrc` Configuration**

```json
{
"php": {
"allow_risky": "no"
}
}
```

##### [PHP-CS-Fixer Path](#php-cs-fixer-path)

**Namespace**: `php`
Expand Down Expand Up @@ -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 (PHP-CS-Fixer 2 only) (Supported by PHP-CS-Fixer)

**Example `.jsbeautifyrc` Configuration**

```json
{
"php": {
"allow_risky": "no"
}
}
```

##### [PHPCBF Path](#phpcbf-path)

**Namespace**: `php`
Expand Down
1 change: 1 addition & 0 deletions src/beautifiers/php-cs-fixer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = class PHPCSFixer extends Beautifier
"fix"
"--rules=#{options.rules}" if options.rules
"--config=#{configFile}" if configFile
"--allow-risky=#{options.allow_risky}" if options.allow_risky
"--using-cache=no"
]
if version is 1
Expand Down
6 changes: 6 additions & 0 deletions src/languages/php.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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 (PHP-CS-Fixer 2 only)"
phpcbf_path:
title: "PHPCBF Path"
type: 'string'
Expand Down
18 changes: 18 additions & 0 deletions src/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -5852,6 +5852,24 @@
"namespace": "php"
}
},
"allow_risky": {
"title": "Allow risky rules",
"type": "string",
"default": "no",
"enum": [
"no",
"yes"
],
"description": "allow risky rules to be applied (PHP-CS-Fixer 2 only) (Supported by PHP-CS-Fixer)",
"beautifiers": [
"PHP-CS-Fixer"
],
"key": "allow_risky",
"language": {
"name": "PHP",
"namespace": "php"
}
},
"phpcbf_path": {
"title": "PHPCBF Path",
"type": "string",
Expand Down

0 comments on commit 8ae9669

Please sign in to comment.