Add rubocop formatter (#176)

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

View file

@ -31,6 +31,7 @@ The format is based on [Keep a Changelog].
* [`html-tidy`](https://www.html-tidy.org/) for HTML/XML ([#173]).
* [`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]).
[#168]: https://github.com/radian-software/apheleia/pull/168
[#169]: https://github.com/radian-software/apheleia/pull/169
@ -40,6 +41,7 @@ The format is based on [Keep a Changelog].
[#173]: https://github.com/radian-software/apheleia/pull/173
[#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
[#182]: https://github.com/radian-software/apheleia/pull/182
[#187]: https://github.com/radian-software/apheleia/pull/187

View file

@ -127,6 +127,8 @@
. (npx "prettier" "--stdin-filepath" filepath "--parser=yaml"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(purs-tidy . (npx "purs-tidy" "format"))
(rubocop . ("rubocop" "--stdin" filepath "--auto-correct"
"--stderr" "--format" "quiet" "--fail-level" "fatal"))
(shfmt . ("shfmt"
"-filename" filepath
"-ln" (cl-case (bound-and-true-p sh-shell)

View file

@ -0,0 +1,3 @@
apt-get install -y ruby ruby-dev gcc
gem install rubocop

View file

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

View file

@ -0,0 +1,15 @@
d = [30_644_250_780, 9_003_106_878,
30_636_278_846, 66_641_217_692, 4_501_790_980,
67_124_603_036, 13_161_973_916, 66_606_629_920,
30_642_677_916, 30_643_069_058]; a = []
s = $*[0]
s.each_byte do |b|
a << ('%036b' % d[b
.chr.to_i]).scan(/\d{6}/)
end
a.transpose.each do |a|
a.join.each_byte do |i|
print i == 49 ? ($*[1] || '#') : 32.chr
end
puts
end