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
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
2
410
CSC509 Lecture 09
javiergs
PRO
0
290
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
280
iOSでSVG画像を扱う
kishikawakatsumi
0
180
Researchlyの開発で参考にしたデザイン
adsholoko
0
110
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
2k
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
130
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
460
Developer Joy - The New Paradigm
hollycummins
1
410
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
120
Making Angular Apps Smarter with Generative AI: Local and Offline-capable
christianliebel
PRO
0
110
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
250
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
57k
The Language of Interfaces
destraynor
162
25k
Testing 201, or: Great Expectations
jmmastey
46
7.7k
Side Projects
sachag
455
43k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
910
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Context Engineering - Making Every Token Count
addyosmani
8
330
How to Think Like a Performance Engineer
csswizardry
27
2.2k
Done Done
chrislema
186
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
Raft: Consensus for Rubyists
vanstee
140
7.2k
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