Closes #142. Add options (tabs, spaces, indent_count) for Ruby-Beautify

This commit is contained in:
Glavin Wiechert 2015-06-10 19:20:08 -03:00
parent 9b7abdc707
commit a0e07c232d
4 changed files with 64 additions and 7 deletions

View File

@ -819,11 +819,27 @@ do not fix these errors/warnings (Supported by autopep8)
**Type**: `integer` **Type**: `integer`
**Supported Beautifiers**: [`Rubocop`](#rubocop) **Supported Beautifiers**: [`Rubocop`](#rubocop) [`Ruby Beautify`](#ruby-beautify)
**Description**: **Description**:
Indentation size/length (Supported by Rubocop) Indentation size/length (Supported by Rubocop, Ruby Beautify)
#### [Ruby - Indent char](#ruby---indent-char)
**Key**: `ruby_indent_char`
**Default**: ` `
**Type**: `string`
**Enum**: ` ` ` `
**Supported Beautifiers**: [`Ruby Beautify`](#ruby-beautify)
**Description**:
Indentation character (Supported by Ruby Beautify)
#### [Rust - Rustfmt path](#rust---rustfmt-path) #### [Rust - Rustfmt path](#rust---rustfmt-path)
@ -3173,11 +3189,44 @@ do not fix these errors/warnings (Supported by autopep8)
**Type**: `integer` **Type**: `integer`
**Supported Beautifiers**: [`Rubocop`](#rubocop) **Supported Beautifiers**: [`Rubocop`](#rubocop) [`Ruby Beautify`](#ruby-beautify)
**Description**: **Description**:
Indentation size/length (Supported by Rubocop) Indentation size/length (Supported by Rubocop, Ruby Beautify)
### Ruby Beautify
#### [Ruby - Indent size](#ruby---indent-size)
**Key**: `ruby_indent_size`
**Default**: `4`
**Type**: `integer`
**Supported Beautifiers**: [`Rubocop`](#rubocop) [`Ruby Beautify`](#ruby-beautify)
**Description**:
Indentation size/length (Supported by Rubocop, Ruby Beautify)
#### [Ruby - Indent char](#ruby---indent-char)
**Key**: `ruby_indent_char`
**Default**: ` `
**Type**: `string`
**Enum**: ` ` ` `
**Supported Beautifiers**: [`Ruby Beautify`](#ruby-beautify)
**Description**:
Indentation character (Supported by Ruby Beautify)
### rustfmt ### rustfmt

View File

@ -9,12 +9,15 @@ module.exports = class RubyBeautify extends Beautifier
name: "Ruby Beautify" name: "Ruby Beautify"
options: { options: {
Ruby: false Ruby:
indent_size: true
indent_char: true
} }
beautify: (text, language, options) -> beautify: (text, language, options) ->
@deprecate("Ruby-Beautify has been deprecated in favour of Rubocop beautifier.")
@run("rbeautify", [ @run("rbeautify", [
if options.indent_char is '\t' then "--tabs" else "--spaces"
"--indent_count", options.indent_count
@tempFile("input", text) @tempFile("input", text)
], help: { ], help: {
link: "https://github.com/erniebrodeur/ruby-beautify" link: "https://github.com/erniebrodeur/ruby-beautify"

View File

@ -39,7 +39,6 @@ module.exports = {
indent_char: indent_char:
type: 'string' type: 'string'
default: defaultIndentChar default: defaultIndentChar
minimum: 0
description: "Indentation character" description: "Indentation character"
indent_level: indent_level:
type: 'integer' type: 'integer'

View File

@ -31,5 +31,11 @@ module.exports = {
default: defaultIndentSize default: defaultIndentSize
minimum: 0 minimum: 0
description: "Indentation size/length" description: "Indentation size/length"
indent_char:
type: 'string'
default: defaultIndentChar
description: "Indentation character"
enum: [" ", "\t"]
} }