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
130
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
150
Hex Core
wojtekmach
0
150
Recurrences & Intervals
wojtekmach
2
480
Building an Umbrella Project
wojtekmach
21
6k
Advanced OOP in Elixir
wojtekmach
6
670
OOP in Elixir
wojtekmach
4
300
Pattern Matching
wojtekmach
1
310
Other Decks in Programming
See All in Programming
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
130
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
340
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.5k
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
160
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
360
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
2
170
Event Storming
hschwentner
3
1.3k
AIプロダクト時代のQAエンジニアに求められること
imtnd
1
480
CSC307 Lecture 13
javiergs
PRO
0
300
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
150
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
140
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
190
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
170
Test your architecture with Archunit
thirion
1
2.2k
Code Reviewing Like a Champion
maltzj
527
40k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
250
How GitHub (no longer) Works
holman
316
140k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
750
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
130
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
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