Merge pull request #1193 from qwemaze/prettydiff-bracepadding

Add PrettyDiff's bracepadding support
This commit is contained in:
Glavin Wiechert 2016-09-15 20:27:04 -03:00 committed by GitHub
commit 6f934f974a
4 changed files with 113 additions and 8 deletions

View File

@ -8,6 +8,7 @@
- Closes [#786](https://github.com/Glavin001/atom-beautify/issues/786) YAPF configuration files are ignored. - Closes [#786](https://github.com/Glavin001/atom-beautify/issues/786) YAPF configuration files are ignored.
- Fix phpcbf hanging issue by closing stdin. See [#893](https://github.com/Glavin001/atom-beautify/issues/893) - Fix phpcbf hanging issue by closing stdin. See [#893](https://github.com/Glavin001/atom-beautify/issues/893)
- Add warning notification when parsing `.jsbeautifyrc` as JSON or YAML fails. See [#1106](https://github.com/Glavin001/atom-beautify/issues/1106) - Add warning notification when parsing `.jsbeautifyrc` as JSON or YAML fails. See [#1106](https://github.com/Glavin001/atom-beautify/issues/1106)
- Add support for PrettyDiff's *bracepadding* option in JavaScript. See [#1157](https://github.com/Glavin001/atom-beautify/issues/1157)
# v0.29.0 # v0.29.0
- Closes [#447](https://github.com/Glavin001/atom-beautify/issues/447). Improved Handlebars language support - Closes [#447](https://github.com/Glavin001/atom-beautify/issues/447). Improved Handlebars language support

View File

@ -2088,6 +2088,7 @@ Path to uncrustify config file. i.e. uncrustify.cfg (Supported by Uncrustify)
| `indent_with_tabs` | :white_check_mark: | | `indent_with_tabs` | :white_check_mark: |
| `preserve_newlines` | :white_check_mark: | | `preserve_newlines` | :white_check_mark: |
| `space_after_anon_function` | :white_check_mark: | | `space_after_anon_function` | :white_check_mark: |
| `space_in_paren` | :white_check_mark: |
| `wrap_line_length` | :white_check_mark: | | `wrap_line_length` | :white_check_mark: |
**Description**: **Description**:
@ -2323,6 +2324,30 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
} }
``` ```
##### [Space in paren](#space-in-paren)
**Namespace**: `js`
**Key**: `space_in_paren`
**Type**: `boolean`
**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff)
**Description**:
Add padding spaces within paren, ie. f( a, b ) (Supported by Pretty Diff)
**Example `.jsbeautifyrc` Configuration**
```json
{
"js": {
"space_in_paren": false
}
}
```
##### [Wrap line length](#wrap-line-length) ##### [Wrap line length](#wrap-line-length)
**Namespace**: `html` **Namespace**: `html`
@ -4276,7 +4301,7 @@ Path to uncrustify config file. i.e. uncrustify.cfg (Supported by Uncrustify)
| `preserve_newlines` | :white_check_mark: | :x: | :white_check_mark: | | `preserve_newlines` | :white_check_mark: | :x: | :white_check_mark: |
| `space_after_anon_function` | :white_check_mark: | :x: | :white_check_mark: | | `space_after_anon_function` | :white_check_mark: | :x: | :white_check_mark: |
| `space_before_conditional` | :white_check_mark: | :x: | :x: | | `space_before_conditional` | :white_check_mark: | :x: | :x: |
| `space_in_paren` | :white_check_mark: | :x: | :x: | | `space_in_paren` | :white_check_mark: | :x: | :white_check_mark: |
| `unescape_strings` | :white_check_mark: | :x: | :x: | | `unescape_strings` | :white_check_mark: | :x: | :x: |
| `wrap_line_length` | :white_check_mark: | :x: | :white_check_mark: | | `wrap_line_length` | :white_check_mark: | :x: | :white_check_mark: |
@ -4745,11 +4770,11 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
**Type**: `boolean` **Type**: `boolean`
**Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff)
**Description**: **Description**:
Add padding spaces within paren, ie. f( a, b ) (Supported by JS Beautify) Add padding spaces within paren, ie. f( a, b ) (Supported by JS Beautify, Pretty Diff)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -4834,7 +4859,7 @@ Wrap lines at next opportunity after N characters (Supported by JS Beautify, Pre
| `preserve_newlines` | :white_check_mark: | :white_check_mark: | | `preserve_newlines` | :white_check_mark: | :white_check_mark: |
| `space_after_anon_function` | :white_check_mark: | :white_check_mark: | | `space_after_anon_function` | :white_check_mark: | :white_check_mark: |
| `space_before_conditional` | :white_check_mark: | :x: | | `space_before_conditional` | :white_check_mark: | :x: |
| `space_in_paren` | :white_check_mark: | :x: | | `space_in_paren` | :white_check_mark: | :white_check_mark: |
| `unescape_strings` | :white_check_mark: | :x: | | `unescape_strings` | :white_check_mark: | :x: |
| `wrap_line_length` | :white_check_mark: | :white_check_mark: | | `wrap_line_length` | :white_check_mark: | :white_check_mark: |
@ -5303,11 +5328,11 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
**Type**: `boolean` **Type**: `boolean`
**Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff)
**Description**: **Description**:
Add padding spaces within paren, ie. f( a, b ) (Supported by JS Beautify) Add padding spaces within paren, ie. f( a, b ) (Supported by JS Beautify, Pretty Diff)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -5383,6 +5408,7 @@ Wrap lines at next opportunity after N characters (Supported by JS Beautify, Pre
| `indent_with_tabs` | :white_check_mark: | | `indent_with_tabs` | :white_check_mark: |
| `preserve_newlines` | :white_check_mark: | | `preserve_newlines` | :white_check_mark: |
| `space_after_anon_function` | :white_check_mark: | | `space_after_anon_function` | :white_check_mark: |
| `space_in_paren` | :white_check_mark: |
| `wrap_line_length` | :white_check_mark: | | `wrap_line_length` | :white_check_mark: |
**Description**: **Description**:
@ -5618,6 +5644,30 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
} }
``` ```
##### [Space in paren](#space-in-paren)
**Namespace**: `js`
**Key**: `space_in_paren`
**Type**: `boolean`
**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff)
**Description**:
Add padding spaces within paren, ie. f( a, b ) (Supported by Pretty Diff)
**Example `.jsbeautifyrc` Configuration**
```json
{
"js": {
"space_in_paren": false
}
}
```
##### [Wrap line length](#wrap-line-length) ##### [Wrap line length](#wrap-line-length)
**Namespace**: `js` **Namespace**: `js`
@ -10491,6 +10541,7 @@ Maximum amount of characters per line (0 = disable) (Supported by Pretty Diff)
| `indent_with_tabs` | :white_check_mark: | | `indent_with_tabs` | :white_check_mark: |
| `preserve_newlines` | :white_check_mark: | | `preserve_newlines` | :white_check_mark: |
| `space_after_anon_function` | :white_check_mark: | | `space_after_anon_function` | :white_check_mark: |
| `space_in_paren` | :white_check_mark: |
| `wrap_line_length` | :white_check_mark: | | `wrap_line_length` | :white_check_mark: |
**Description**: **Description**:
@ -10726,6 +10777,30 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
} }
``` ```
##### [Space in paren](#space-in-paren)
**Namespace**: `js`
**Key**: `space_in_paren`
**Type**: `boolean`
**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff)
**Description**:
Add padding spaces within paren, ie. f( a, b ) (Supported by Pretty Diff)
**Example `.jsbeautifyrc` Configuration**
```json
{
"js": {
"space_in_paren": false
}
}
```
##### [Wrap line length](#wrap-line-length) ##### [Wrap line length](#wrap-line-length)
**Namespace**: `html` **Namespace**: `html`
@ -14116,11 +14191,11 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by J
**Type**: `boolean` **Type**: `boolean`
**Supported Beautifiers**: [`JS Beautify`](#js-beautify) **Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff)
**Description**: **Description**:
Add padding spaces within paren, ie. f( a, b ) (Supported by JS Beautify) Add padding spaces within paren, ie. f( a, b ) (Supported by JS Beautify, Pretty Diff)
**Example `.jsbeautifyrc` Configuration** **Example `.jsbeautifyrc` Configuration**
@ -15438,6 +15513,30 @@ Indentation uses tabs, overrides `Indent Size` and `Indent Char` (Supported by P
} }
``` ```
##### [Space in paren](#space-in-paren)
**Namespace**: `js`
**Key**: `space_in_paren`
**Type**: `boolean`
**Supported Beautifiers**: [`Pretty Diff`](#pretty-diff)
**Description**:
Add padding spaces within paren, ie. f( a, b ) (Supported by Pretty Diff)
**Example `.jsbeautifyrc` Configuration**
```json
{
"js": {
"space_in_paren": false
}
}
```
##### [Space after anon function](#space-after-anon-function) ##### [Space after anon function](#space-after-anon-function)
**Namespace**: `js` **Namespace**: `js`

View File

@ -106,6 +106,10 @@
{ {
"name": "Louis G Vichy", "name": "Louis G Vichy",
"url": "https://github.com/louisgv" "url": "https://github.com/louisgv"
},
{
"name": "Elias Baryshnikov",
"url": "https://github.com/qwemaze"
} }
], ],
"engines": { "engines": {

View File

@ -41,6 +41,7 @@ module.exports = class PrettyDiff extends Beautifier
false else true false else true
] ]
ternaryline: "preserve_ternary_lines" ternaryline: "preserve_ternary_lines"
bracepadding: "space_in_paren"
# Apply language-specific options # Apply language-specific options
CSV: true CSV: true
Coldfusion: true Coldfusion: true