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
110
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
420
Building an Umbrella Project
wojtekmach
21
5.7k
Advanced OOP in Elixir
wojtekmach
6
640
OOP in Elixir
wojtekmach
4
290
Pattern Matching
wojtekmach
1
290
Other Decks in Programming
See All in Programming
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
120
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Zoneless Testing
rainerhahnekamp
0
120
Haze - Real time background blurring
chrisbanes
1
510
たのしいparse.y
ydah
3
120
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
130
Featured
See All Featured
Building an army of robots
kneath
302
44k
The Invisible Side of Design
smashingmag
298
50k
Why Our Code Smells
bkeepers
PRO
335
57k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
97
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Optimising Largest Contentful Paint
csswizardry
33
3k
Gamification - CAS2011
davidbonilla
80
5.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
We Have a Design System, Now What?
morganepeng
51
7.3k
Thoughts on Productivity
jonyablonski
67
4.4k
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