mirror of
https://github.com/vale981/apheleia
synced 2025-03-05 09:31:40 -05:00
Add rubocop formatter (#176)
This commit is contained in:
parent
93c11bf5e3
commit
95bea3371b
5 changed files with 23 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
3
test/formatters/installers/rubocop.bash
Normal file
3
test/formatters/installers/rubocop.bash
Normal file
|
@ -0,0 +1,3 @@
|
|||
apt-get install -y ruby ruby-dev gcc
|
||||
|
||||
gem install rubocop
|
1
test/formatters/samplecode/rubocop/in.rb
Symbolic link
1
test/formatters/samplecode/rubocop/in.rb
Symbolic link
|
@ -0,0 +1 @@
|
|||
../prettier-ruby/in.rb
|
15
test/formatters/samplecode/rubocop/out.rb
Normal file
15
test/formatters/samplecode/rubocop/out.rb
Normal 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
|
Loading…
Add table
Reference in a new issue