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
140
Hex Core
wojtekmach
0
130
Recurrences & Intervals
wojtekmach
2
450
Building an Umbrella Project
wojtekmach
21
5.9k
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
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
520
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
690
Select API from Kotlin Coroutine
jmatsu
1
190
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
1
560
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
270
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
920
関数型まつり2025登壇資料「関数プログラミングと再帰」
taisontsukada
2
850
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
370
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
370
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
430
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
童醫院敏捷轉型的實踐經驗
cclai999
0
190
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
57
9.4k
Statistics for Hackers
jakevdp
799
220k
Practical Orchestrator
shlominoach
188
11k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
670
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.3k
Embracing the Ebb and Flow
colly
86
4.7k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
800
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Code Reviewing Like a Champion
maltzj
524
40k
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