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
88
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
110
Hex Core
wojtekmach
0
120
Recurrences & Intervals
wojtekmach
2
370
Building an Umbrella Project
wojtekmach
21
5.5k
Advanced OOP in Elixir
wojtekmach
6
620
OOP in Elixir
wojtekmach
4
280
Pattern Matching
wojtekmach
1
280
Other Decks in Programming
See All in Programming
DDD, necessary but insufficient: physical design principles for microservices
cer
PRO
0
2.2k
PHP8の機能を使って堅牢にコードを書く
fendo181
6
2.6k
RubyVM を PHP で実装する 〜Hello World を出力するまで〜
memory1994
PRO
1
490
document.write再考
brn
5
2.5k
Cloud RunとCloud PubSubでサーバレスなデータ基盤2024 with Terraform / Cloud Run and PubSub with Terraform
shinyorke
7
1.9k
TDDと今まで
kanayannet
0
140
[スクリプト] Swiftの型推論を学ぼう
omochi
0
110
設計の知識と技能で駆動するソフトウェア開発
masuda220
PRO
18
10k
クソコード動画『カプセル化 Mk-II』 で考える 上手くカプセル化できない理由 / encapsulation2
minodriven
11
7.8k
Some Quick Ideas To Improve Your Tests ( #jassttokyo )
teyamagu
PRO
2
2.3k
BuefyのMaintainerを引き継いだ件
kikuomax
0
520
WebComponentsで フレームワークを1ページに共存させる
webuilder240
0
150
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
28
46k
For a Future-Friendly Web
brad_frost
170
8.9k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
Building Better People: How to give real-time feedback that sticks.
wjessup
350
18k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
178
11k
The World Runs on Bad Software
bkeepers
PRO
60
6.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.3k
Designing with Data
zakiwarfel
94
4.8k
Web development in the modern age
philhawksworth
201
10k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.4k
It's Worth the Effort
3n
180
27k
Embracing the Ebb and Flow
colly
78
4.1k
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