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
110
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
410
Building an Umbrella Project
wojtekmach
21
5.7k
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
僕がつくった48個のWebサービス達
yusukebe
20
17k
Ethereum_.pdf
nekomatu
0
370
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
110
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
500
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
みんなでプロポーザルを書いてみた
yuriko1211
0
200
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
2.8k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
450
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
480
JaSST 24 九州:ワークショップ(は除く)実践!マインドマップを活用したソフトウェアテスト+活用事例
satohiroyuki
0
500
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
4
2k
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
120
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Thoughts on Productivity
jonyablonski
67
4.3k
Docker and Python
trallard
40
3.1k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
Producing Creativity
orderedlist
PRO
341
39k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Code Review Best Practice
trishagee
64
17k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Being A Developer After 40
akosma
86
590k
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