Add rufo formatter (#177)

This commit is contained in:
Mohsin Kaleem 2023-04-22 11:56:29 +01:00 committed by GitHub
parent 95bea3371b
commit e9e595f003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 0 deletions

View file

@ -32,6 +32,8 @@ The format is based on [Keep a Changelog].
* [`perltidy`](https://perltidy.sourceforge.net/) for
[perl](https://www.perl.org/) ([#175]).
* [`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
[#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
[#175]: https://github.com/radian-software/apheleia/pull/175
[#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
[#187]: https://github.com/radian-software/apheleia/pull/187

View file

@ -141,6 +141,7 @@
sh-basic-offset)
(t 4)))
"-"))
(rufo . ("rufo" "--filename" filepath "--simple-exit"))
(stylua . ("stylua" "-"))
(rustfmt . ("rustfmt" "--quiet" "--emit" "stdout"))
(terraform . ("terraform" "fmt" "-")))

View file

@ -0,0 +1,2 @@
apt-get install -y ruby
gem install rufo

View file

@ -0,0 +1 @@
../prettier-ruby/in.rb

View 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
}