See #524. Added support for methodchain setting in prettydiff.

This commit is contained in:
Jeff Wheeler 2015-10-07 19:57:56 -04:00
parent 8fd7d946ba
commit 1f2b525f58
2 changed files with 36 additions and 8 deletions

View File

@ -1254,11 +1254,11 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
**Type**: `boolean`
**Supported Beautifiers**: [`JS Beautify`](#js-beautify)
**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff)
**Description**:
Break chained method calls across subsequent lines (Supported by JS Beautify)
Break chained method calls across subsequent lines (Supported by JS Beautify, Pretty Diff)
**Example `.jsbeautifyrc` Configuration**
@ -2007,7 +2007,7 @@ Disable C Beautification
**Type**: `string`
**Enum**: `Uncrustify`
**Enum**: `Uncrustify` `clang-format`
**Description**:
@ -2117,7 +2117,7 @@ Disable C++ Beautification
**Type**: `string`
**Enum**: `Uncrustify`
**Enum**: `Uncrustify` `clang-format`
**Description**:
@ -3162,7 +3162,7 @@ Disable Objective-C Beautification
**Type**: `string`
**Enum**: `Uncrustify`
**Enum**: `Uncrustify` `clang-format`
**Description**:
@ -3437,7 +3437,7 @@ Disable Python Beautification
**Type**: `string`
**Enum**: `autopep8`
**Enum**: `autopep8` `yapf`
**Description**:
@ -5224,11 +5224,11 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
**Type**: `boolean`
**Supported Beautifiers**: [`JS Beautify`](#js-beautify)
**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff)
**Description**:
Break chained method calls across subsequent lines (Supported by JS Beautify)
Break chained method calls across subsequent lines (Supported by JS Beautify, Pretty Diff)
**Example `.jsbeautifyrc` Configuration**
@ -5893,6 +5893,30 @@ Add a space before an anonymous function's parens, ie. function () (Supported by
}
```
#### [JavaScript - Break chained methods](#javascript---break-chained-methods)
**Namespace**: `js`
**Key**: `break_chained_methods`
**Type**: `boolean`
**Supported Beautifiers**: [`JS Beautify`](#js-beautify) [`Pretty Diff`](#pretty-diff)
**Description**:
Break chained method calls across subsequent lines (Supported by JS Beautify, Pretty Diff)
**Example `.jsbeautifyrc` Configuration**
```json
{
"js": {
"break_chained_methods": false
}
}
```
#### [JavaScript - Wrap line length](#javascript---wrap-line-length)
**Namespace**: `js`

View File

@ -29,6 +29,10 @@ module.exports = class PrettyDiff extends Beautifier
space: "space_after_anon_function"
noleadzero: "no_lead_zero"
endcomma: "end_with_comma"
methodchain: ['break_chained_methods', (break_chained_methods) ->
if (break_chained_methods is true ) then \
false else true
]
# Apply language-specific options
CSV: true
ERB: true