Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Formatting ruby code
Search
Wojtek Mach
April 16, 2014
Programming
0
120
Formatting ruby code
Wojtek Mach
April 16, 2014
Tweet
Share
More Decks by Wojtek Mach
See All by Wojtek Mach
Writing an Ecto Adapter: Introducing MyXQL
wojtekmach
1
130
Hex Core
wojtekmach
0
130
Recurrences & Intervals
wojtekmach
2
440
Building an Umbrella Project
wojtekmach
21
5.8k
Advanced OOP in Elixir
wojtekmach
6
640
OOP in Elixir
wojtekmach
4
300
Pattern Matching
wojtekmach
1
300
Other Decks in Programming
See All in Programming
Day0 初心者向けワークショップ実践!ソフトウェアテストの第一歩
satohiroyuki
0
830
サービスレベルを管理してアジャイルを加速しよう!! / slm-accelerate-agility
tomoyakitaura
1
170
趣味全開のAITuber開発
kokushin
0
190
スモールスタートで始めるためのLambda×モノリス
akihisaikeda
2
180
マルチアカウント環境での、そこまでがんばらない RI/SP 運用設計
wa6sn
0
710
国漢文混用体からHolloまで
minhee
1
170
AHC 044 混合整数計画ソルバー解法
kiri8128
0
330
生成AIを使ったQAアプリケーションの作成 - ハンズオン補足資料
oracle4engineer
PRO
3
200
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
220
AHC045_解説
shun_pi
0
480
PHPで書いたAPIをGoに書き換えてみた 〜パフォーマンス改善の可能性を探る実験レポート〜
koguuum
0
140
Devin入門と最近のアップデートから見るDevinの進化 / Introduction to Devin and the Evolution of Devin as Seen in Recent Update
rkaga
9
4.8k
Featured
See All Featured
Optimizing for Happiness
mojombo
377
70k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
GraphQLの誤解/rethinking-graphql
sonatard
71
10k
Done Done
chrislema
183
16k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
13
1.4k
Side Projects
sachag
452
42k
Building Applications with DynamoDB
mza
94
6.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
GraphQLとの向き合い方2022年版
quramy
46
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
178
53k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Music & Morning Musume
bryan
47
6.5k
Transcript
Formatting Ruby Code
4 rules of simple design (Kent Beck) 1. All tests
pass 2. No duplicate code 3. Express all the ideas 4. Minimize classes and methods
4 rules of simple design (Kent Beck) 1. All tests
pass 2. No duplicate code 3. Express all the ideas 4. Minimize classes and methods 0. Code is properly formatted
Styleguides • https://github.com/bbatsov/ruby-style-guide • https://github.com/styleguide/ruby • etc
Styleguides
Styleguides • Styleguides are great, but...
Styleguides • Styleguides are great, but… • “Hey, can you
format code according to …”?
Go
Go • Go doesn’t have styleguides
Go • Go doesn’t have styleguides • gofmt a.go
rubyfmt
Parsing ruby code
Parsing ruby code https://github.com/seattlerb/ruby_parser
Parsing ruby code https://github.com/seattlerb/ruby2ruby
Diff
None
https://github.com/wojtekmach/rubyfmtbot
Thanks! • http://golang.org/cmd/gofmt • https://github.com/seattlerb/ruby_parser • https://github.com/seattlerb/sexp_processor • https://github.com/seattlerb/ruby2ruby •
https://github.com/wojtekmach/rubyfmt • https://github.com/wojtekmach/rubyfmtbot