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
130
Hex Core
wojtekmach
0
130
Recurrences & Intervals
wojtekmach
2
430
Building an Umbrella Project
wojtekmach
21
5.8k
Advanced OOP in Elixir
wojtekmach
6
640
OOP in Elixir
wojtekmach
4
290
Pattern Matching
wojtekmach
1
290
Other Decks in Programming
See All in Programming
Linux && Docker 研修/Linux && Docker training
forrep
23
4.5k
Writing documentation can be fun with plugin system
okuramasafumi
0
120
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
550
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
890
Lottieアニメーションをカスタマイズしてみた
tahia910
0
120
Ruby on cygwin 2025-02
fd0
0
140
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
180
Domain-Driven Transformation
hschwentner
2
1.9k
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
260
Unity Android XR入門
sakutama_11
0
140
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
370
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
340
Featured
See All Featured
Speed Design
sergeychernyshev
25
780
Facilitating Awesome Meetings
lara
51
6.2k
Embracing the Ebb and Flow
colly
84
4.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
29
4.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Navigating Team Friction
lara
183
15k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
540
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