Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ruby-standard formatter #201

Merged
merged 4 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apheleia.el
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
(purs-tidy . (npx "purs-tidy" "format"))
(rubocop . ("rubocop" "--stdin" filepath "--auto-correct"
"--stderr" "--format" "quiet" "--fail-level" "fatal"))
(ruby-standard . ("standardrb" "--stdin" filepath "--fix" "--stderr"
"--format" "quiet" "--fail-level" "fatal"))
(shfmt . ("shfmt"
"-filename" filepath
"-ln" (cl-case (bound-and-true-p sh-shell)
Expand Down
3 changes: 3 additions & 0 deletions test/formatters/installers/ruby-standard.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apt-get install -y ruby ruby-dev gcc

gem install standard
1 change: 1 addition & 0 deletions test/formatters/samplecode/ruby-standard/in.rb
16 changes: 16 additions & 0 deletions test/formatters/samplecode/ruby-standard/out.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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