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
640
OOP in Elixir
wojtekmach
4
300
Pattern Matching
wojtekmach
1
300
Other Decks in Programming
See All in Programming
RDoc meets YARD
okuramasafumi
4
170
Kiroで始めるAI-DLC
kaonash
2
590
はじめてのMaterial3 Expressive
ym223
2
740
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
600
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
120
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
520
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
760
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
220
AWS発のAIエディタKiroを使ってみた
iriikeita
1
190
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
為你自己學 Python - 冷知識篇
eddie
1
350
Featured
See All Featured
Speed Design
sergeychernyshev
32
1.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
112
20k
YesSQL, Process and Tooling at Scale
rocio
173
14k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Fireside Chat
paigeccino
39
3.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
The Language of Interfaces
destraynor
161
25k
Writing Fast Ruby
sferik
628
62k
How to Ace a Technical Interview
jacobian
279
23k
Code Reviewing Like a Champion
maltzj
525
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