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
140
Recurrences & Intervals
wojtekmach
2
460
Building an Umbrella Project
wojtekmach
21
5.9k
Advanced OOP in Elixir
wojtekmach
6
650
OOP in Elixir
wojtekmach
4
300
Pattern Matching
wojtekmach
1
300
Other Decks in Programming
See All in Programming
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
170
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
0
1.3k
XP, Testing and ninja testing ZOZ5
m_seki
3
670
そのpreloadは必要?見過ごされたpreloadが技術的負債として爆発した日
mugitti9
2
3.4k
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
240
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
280
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
1
370
Devoxx BE - Local Development in the AI Era
kdubois
0
130
Go言語はstack overflowの夢を見るか?
logica0419
0
340
All About Angular's New Signal Forms
manfredsteyer
PRO
0
160
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
540
CSC305 Lecture 08
javiergs
PRO
0
210
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Building Adaptive Systems
keathley
44
2.8k
Balancing Empowerment & Direction
lara
4
690
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
For a Future-Friendly Web
brad_frost
180
10k
Being A Developer After 40
akosma
91
590k
How to Ace a Technical Interview
jacobian
280
24k
GraphQLとの向き合い方2022年版
quramy
49
14k
Thoughts on Productivity
jonyablonski
70
4.9k
The Invisible Side of Design
smashingmag
302
51k
Docker and Python
trallard
46
3.6k
What's in a price? How to price your products and services
michaelherold
246
12k
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