mirror of
https://github.com/vale981/apheleia
synced 2025-03-05 17:41:41 -05:00
Add rufo formatter (#177)
This commit is contained in:
parent
95bea3371b
commit
e9e595f003
5 changed files with 21 additions and 0 deletions
|
@ -32,6 +32,8 @@ The format is based on [Keep a Changelog].
|
||||||
* [`perltidy`](https://perltidy.sourceforge.net/) for
|
* [`perltidy`](https://perltidy.sourceforge.net/) for
|
||||||
[perl](https://www.perl.org/) ([#175]).
|
[perl](https://www.perl.org/) ([#175]).
|
||||||
* [`rubocop`](https://github.com/rubocop/rubocop) for [ruby](https://www.ruby-lang.org/en/) ([#176]).
|
* [`rubocop`](https://github.com/rubocop/rubocop) for [ruby](https://www.ruby-lang.org/en/) ([#176]).
|
||||||
|
* [`rufo`](https://github.com/ruby-formatter/rufo) for
|
||||||
|
[Ruby](https://www.ruby-lang.org/en/) ([#177]).
|
||||||
|
|
||||||
[#168]: https://github.com/radian-software/apheleia/pull/168
|
[#168]: https://github.com/radian-software/apheleia/pull/168
|
||||||
[#169]: https://github.com/radian-software/apheleia/pull/169
|
[#169]: https://github.com/radian-software/apheleia/pull/169
|
||||||
|
@ -42,6 +44,7 @@ The format is based on [Keep a Changelog].
|
||||||
[#174]: https://github.com/radian-software/apheleia/pull/174
|
[#174]: https://github.com/radian-software/apheleia/pull/174
|
||||||
[#175]: https://github.com/radian-software/apheleia/pull/175
|
[#175]: https://github.com/radian-software/apheleia/pull/175
|
||||||
[#176]: https://github.com/radian-software/apheleia/pull/176
|
[#176]: https://github.com/radian-software/apheleia/pull/176
|
||||||
|
[#177]: https://github.com/radian-software/apheleia/pull/177
|
||||||
[#182]: https://github.com/radian-software/apheleia/pull/182
|
[#182]: https://github.com/radian-software/apheleia/pull/182
|
||||||
[#187]: https://github.com/radian-software/apheleia/pull/187
|
[#187]: https://github.com/radian-software/apheleia/pull/187
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,7 @@
|
||||||
sh-basic-offset)
|
sh-basic-offset)
|
||||||
(t 4)))
|
(t 4)))
|
||||||
"-"))
|
"-"))
|
||||||
|
(rufo . ("rufo" "--filename" filepath "--simple-exit"))
|
||||||
(stylua . ("stylua" "-"))
|
(stylua . ("stylua" "-"))
|
||||||
(rustfmt . ("rustfmt" "--quiet" "--emit" "stdout"))
|
(rustfmt . ("rustfmt" "--quiet" "--emit" "stdout"))
|
||||||
(terraform . ("terraform" "fmt" "-")))
|
(terraform . ("terraform" "fmt" "-")))
|
||||||
|
|
2
test/formatters/installers/rufo.bash
Normal file
2
test/formatters/installers/rufo.bash
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
apt-get install -y ruby
|
||||||
|
gem install rufo
|
1
test/formatters/samplecode/rufo/in.rb
Symbolic link
1
test/formatters/samplecode/rufo/in.rb
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../prettier-ruby/in.rb
|
14
test/formatters/samplecode/rufo/out.rb
Normal file
14
test/formatters/samplecode/rufo/out.rb
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
d = [30644250780, 9003106878,
|
||||||
|
30636278846, 66641217692, 4501790980,
|
||||||
|
671_24_603036, 131_61973916, 66_606629_920,
|
||||||
|
30642677916, 30643069058]; a, s = [], $*[0]
|
||||||
|
s.each_byte { |b|
|
||||||
|
a << ("%036b" % d[b.
|
||||||
|
chr.to_i]).scan(/\d{6}/)
|
||||||
|
}
|
||||||
|
a.transpose.each { |a|
|
||||||
|
a.join.each_byte { |i|
|
||||||
|
print i == 49 ? ($*[1] || "#") : 32.chr
|
||||||
|
}
|
||||||
|
puts
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue