0.18.5 • Published 4 years ago

xinminlabs-plugin-ruby v0.18.5

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

xinminlabs-plugin-ruby

This is a fork of prettier plugin-ruby, which is used in Awesome Code

It contains the following changes

do not add line break for aref node

e.g.

hello.foo.bar.hello.foo.bar.hello.foo.bar.hello.foo.bar.hello.foo.bar.hello['test']

won't be transformed to

hello.foo.bar.hello.foo.bar.hello.foo.bar.hello.foo.bar.hello.foo.bar.hello[
  'test'
]

do not transform to ternary condition and vice versa

e.g.

if File.directory? entry
  Dir[File.join(entry, '**', "*.rb")]
else
  entry
end

won't be transformed to

File.directory? entry ? Dir[File.join(entry, '**', "*.rb")] : entry

do not transform multiline if to inline if and vice versa

e.g.

if result
  'foo'
else
  'bar'
end

won't be transformed to

result ? 'foo' : 'bar'

do not transform multiline while to inline while and vice verse

e.g.

while true
  break :value
end

won't be transformed to

break :value while true

do not transform to single line block and vice versa

e.g.

included do
  has_many :build_items, dependent: :destroy
end

won't be transformed to

included { has_many :build_items, dependent: :destroy }

do not tranform string_embexpr

"node ./node_modules/prettier/bin-prettier.js --plugin ./node_modules/xinminlabs-plugin-ruby --config #{FormatTool::DOCKER_FORMATRC_YAML} --ignore-path #{FormatTool::DOCKER_FORMAT_IGNORE} --write #{FormatTool::DOCKER_INPUT_PATH}/**/*.{rb,rake}"

won't be transformed to

"node ./node_modules/prettier/bin-prettier.js --plugin
./node_modules/xinminlabs-plugin-ruby --config #{
  FormatTool::DOCKER_FORMATRC_YAML
} --ignore-path #{FormatTool::DOCKER_FORMAT_IGNORE} --write #{
  FormatTool::DOCKER_INPUT_PATH
}/**/*.{rb,rake}"

do not transform to string or symbol array

['foo']
[:bar]

won't be transformed to

%w[foo]
%i[bar]

do not transform regexp

/abc/

won't be transformed to

%r{abc}

do not transform to to_proc

array.each { |element| element.to_s }

won't be transformed to

array.each(&:to_s)
0.18.5

4 years ago

0.18.4

4 years ago

0.18.3

4 years ago

0.18.2

4 years ago

0.18.1

4 years ago

0.18.0

4 years ago

0.17.10

4 years ago

0.17.9

4 years ago

0.17.8

4 years ago

0.17.7

4 years ago

0.17.6

4 years ago

0.17.5

4 years ago

0.17.4

4 years ago

0.17.3

4 years ago

0.17.2

4 years ago

0.17.1

4 years ago

0.17.0

4 years ago