Base styles guides:
- Ruby - bbatsov/ruby-style-guide
- CSS - JT CSS Style Guide
- JavaScript - airbnb/javascript
Our updates:
- Limit lines to 110 characters, in order to remove horizontal scrolling on GitHub when we are doing code review
- Align parameters like:
# not so bad
def send_mail(source)
Mailer.deliver(
to: '[email protected]', from: '[email protected]'
)
end
# good
def send_mail(source)
Mailer.deliver(to: '[email protected]',
from: '[email protected]',
subject: 'Important message',
body: source.text)
end
# good (normal indent)
def send_mail(source)
Mailer.deliver(
to: '[email protected]',
from: '[email protected]',
subject: 'Important message',
body: source.text
)
end
- Use prefix
_
for memo variables:
class TestObject
attr_reader :attr_name
def attr_name
@attr_name ||= lazy_calculation_for_attr_name
end
def public_method_with_memo
@_public_method_with_memo ||= public_method_with_memo_calculcations
end
end
- All bugs should be covered with tests and by TDD
- We use Decorators (in code we called them
Carrier
) as View and Form objects: introduction how to use them - We do not use full Presenters (TODO: add link to first post about them) with tag generations
bin/setup
- cold setuprake setup
rake setup_sample_data
- create PR
- deploy PR to Heroku
- ask verify, to code review and to merge
- add issue on GitHub per each note
- create TODO/FIXME note in the code
- add in code's note link to GitHub's issue
- JavaScript Page logic organisation: https://github.com/tastejs/todomvc/blob/gh-pages/examples/jquery/js/app.js
-
Prefix feature branch names with issue number.
-
do not mess with cosmetics changes
-
Squash multiple trivial commits into a single commit.
-
Convert an existing issue into a pull request:
hub pull-request -i 123
-
Write a good commit message based on http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html with some requirements:
#<github_id>: Capitalized, short (50 chars or less) summary More detailed explanatory ... Closes #<other_github_issue_id>
Also some examples: https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message
-
Project management:
- Used user stories format: https://www.mountaingoatsoftware.com/agile/user-stories and http://www.alexandercowan.com/best-agile-user-story/
- Tests scenarios and Reproduction steps format: https://github.com/cucumber/cucumber/wiki/Given-When-Then
-
Tutorials:
- Exceptions should be exceptional.
- KISS ... your ARSE :P
- Stub/Mock only external services or code with hard simulation: https://www.youtube.com/watch?v=z9quxZsLcfo&feature=youtu.be&t=21m00s
- Four-Phase Test
- HTML/CSS3:
- Web Performance:
- ES6: https://www.eventbrite.com/engineering/tag/learning-es6/
- Collaboration:
- Chat: Slack
- Issues Plannings: Github, Trello and Waffle.io
- Information board: Hackpad, Google Site, Trello
- Screenshots: Skitch (OS X), Screencloud (Ubuntu, OS X)
- Screencast: Kazam (Ubuntu)
- CI:
- TeamCity (self hosted)
- CircleCI
- Server Conf: Chef
- Deployments: Capistrano
- Assets and File Uploads CDN hosting: AWS, Cloudinary (Images Uploads)
- PAAS for Isolated Staging Testing: Heroku (Rails apps), divshot.io (static HTML)
- Cache: Memcached Cloud from Redis Lab
- JavaScript Base Frameworks: jQuery, React.js, Angular.js, Backbone.js
- SCM: Git on GitHub