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
650
OOP in Elixir
wojtekmach
4
300
Pattern Matching
wojtekmach
1
300
Other Decks in Programming
See All in Programming
CSC509 Lecture 04
javiergs
PRO
0
300
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
980
CSC509 Lecture 03
javiergs
PRO
0
330
理論と実務のギャップを超える
eycjur
0
120
Back to the Future: Let me tell you about the ACP protocol
terhechte
0
140
What's new in Spring Modulith?
olivergierke
1
130
私はどうやって技術力を上げたのか
yusukebe
43
18k
CSC509 Lecture 02
javiergs
PRO
0
410
Advance Your Career with Open Source
ivargrimstad
0
460
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
220
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
140
NetworkXとGNNで学ぶグラフデータ分析入門〜複雑な関係性を解き明かすPythonの力〜
mhrtech
3
1.2k
Featured
See All Featured
Making Projects Easy
brettharned
119
6.4k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
The Language of Interfaces
destraynor
162
25k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
54
3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Building Adaptive Systems
keathley
43
2.8k
GitHub's CSS Performance
jonrohan
1032
470k
How to train your dragon (web standard)
notwaldorf
96
6.3k
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