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
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
420
GUI操作LLMの最新動向: UI-TARSと関連論文紹介
kfujikawa
0
970
新しいモバイルアプリ勉強会(仮)について
uetyo
1
260
未来を拓くAI技術〜エージェント開発とAI駆動開発〜
leveragestech
2
150
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
130
GitHub Copilotの全体像と活用のヒント AI駆動開発の最初の一歩
74th
7
2.9k
なぜ今、Terraformの本を書いたのか? - 著者陣に聞く!『Terraformではじめる実践IaC』登壇資料
fufuhu
4
620
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
380
それ CLI フレームワークがなくてもできるよ / Building CLI Tools Without Frameworks
orgachem
PRO
17
3.9k
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
5
1.6k
Understanding Ruby Grammar Through Conflicts
yui_knk
1
110
0から始めるモジュラーモノリス-クリーンなモノリスを目指して
sushi0120
1
280
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
[RailsConf 2023] Rails as a piece of cake
palkan
56
5.8k
Embracing the Ebb and Flow
colly
86
4.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Producing Creativity
orderedlist
PRO
347
40k
Documentation Writing (for coders)
carmenintech
73
5k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
The Pragmatic Product Professional
lauravandoore
36
6.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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