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
React は次の10年を生き残れるか:3つのトレンドから考える
oukayuka
40
16k
Understanding Kotlin Multiplatform
l2hyunwoo
0
240
リバースエンジニアリング新時代へ! GhidraとClaude DesktopをMCPで繋ぐ/findy202507
tkmru
4
1.6k
JetBrainsのAI機能の紹介 #jjug
yusuke
0
150
なぜあなたのオブザーバビリティ導入は頓挫するのか
ryota_hnk
4
520
GPUを計算資源として使おう!
primenumber
1
300
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
180
Prompt Engineeringの再定義「Context Engineering」とは
htsuruo
0
110
状態遷移図を書こう / Sequence Chart vs State Diagram
orgachem
PRO
3
310
副作用と戦う PHP リファクタリング ─ ドメインイベントでビジネスロジックを解きほぐす
kajitack
3
490
Vibe coding コードレビュー
kinopeee
0
340
コーディングエージェント概観(2025/07)
itsuki_t88
0
460
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
329
21k
Git: the NoSQL Database
bkeepers
PRO
431
65k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Into the Great Unknown - MozCon
thekraken
40
1.9k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
GitHub's CSS Performance
jonrohan
1031
460k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.6k
GraphQLとの向き合い方2022年版
quramy
49
14k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Bash Introduction
62gerente
613
210k
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