is the work that is needed. Remember, a Trello card is a promise of a conversation, not a work order. Make sure branch names are dash-separated, and not underscore_separated. As we move more of our infrastructure to Kubernetes, this becomes more important.
numbers") added = num_1.to_i + num_2.to_i puts added end Martin removes the comment, and adds some trailing whitespace: def add_numbers(num_1, num_2) added = num_1.to_i + num_2.to_i puts added end
numbers") added = num_1.to_i + num_2.to_i puts added end Martin removes the comment, and adds some trailing whitespace: def add_numbers(num_1, num_2) added = num_1.to_i + num_2.to_i puts added end Anna changes a totally different function in the class, but adds more whitespace: def add_numbers(num_1, num_2) added = num_1.to_i + num_2.to_i puts added end
numbers") added = num_1.to_i + num_2.to_i puts added end Martin removes the comment, and adds some trailing whitespace: def add_numbers(num_1, num_2) added = num_1.to_i + num_2.to_i puts added end Anna changes a totally different function in the class, but adds more whitespace: def add_numbers(num_1, num_2) added = num_1.to_i + num_2.to_i puts added end Roger is trying to figure out who wrote the add_numbers function so he can ask them about it, and he gets all kinds of misleading information: Anna > def add_numbers(num_1, num_2) Martin > added = num_1.to_i + num_2.to_i Anna > puts added Susie > end
Variations on this setting muddies the git history and complicates git forensics. Never use git add . when adding code changes. Use git add -p instead. This protects you from making inadvertent additions to the repo (debugging code, tabs instead of spaces, stray characters, etc.)
Variations on this setting muddies the git history and complicates git forensics. Never use git add . when adding code changes. Use git add -p instead. This protects you from making inadvertent additions to the repo (debugging code, tabs instead of spaces, stray characters, etc.) The name of an object should indicate what it does. Doing this reduces cognitive load for anyone reviewing your code, and for anyone working on your code in the future.
elsif !winner.addresses.include?(address) address.update_attributes(:person_id => winner.id, :is_primary => false) end end if winner.addresses.present? && ! winner.addresses.select(&:is_primary?).present? winner.addresses.first.update_attributes(:is_primary => true) end end
if winner_addresses.blank? address.update_attributes(person_id: winner.id) elsif !winner_addresses.include?(address) address.update_attributes(person_id: winner.id, is_primary: false) end end end def set_primary_winner_address if winner_addresses.present? && ! winner_addresses.select(&:is_primary?).present? winner_addresses.first.update_attributes(is_primary: true) end end
the what and the why. Examples that do not achieve this: Respond to feedback Fix spec Make CodeClimate happy Add logging Clean up Abc order God doesn't love ugly
a formalized request that a project maintainer add the submitted code changes to the project repository. Unless otherwise flagged, a PR is a signal to a project maintainer and other contributors to the project that the code it includes is production-ready.
review work in progress, push the branch you’re working on, and ask the reviewer to check it out. Alternatively, you can create a PR so the reviewer can easily review and comment on the work, but make sure you add the WIP label.
review. Create iterative PRs for large features whenever possible. If you find this hard to do, think about taking a large feature branch and figuring out how you could break it up and re-create it in smaller, more digestible chunks that still get the same result.
include contextual information, warn about any “gotchas,” give instructions for testing and deploying, avoid accusatory or defensive language, and include a screenshot or animated GIF to demonstrate UX changes. Or just for fun. :) A PR description should:
that don’t, are the failures legitimate? If so, notify the submitter and pause review. Are there files with conflicts? If so, these should be resolved before the review proceeds, because files will change.
that don’t, are the failures legitimate? If so, notify the submitter and pause review. Are there files with conflicts? If so, these should be resolved before the review proceeds, because files will change. Does the PR have migrations? If so, part of your review should be to run rake db:migrate and rake db:rollback to ensure there are no syntax errors.
to forget to add view files, support files (eg. test import files), images, etc. to the git repo. Examine the fallout of deletions - were all references to a CSS class removed, but the class itself persisted? Same for JS functions, view partials, functions, I18n locale keys, routes, etc.
to forget to add view files, support files (eg. test import files), images, etc. to the git repo. Examine the fallout of deletions - were all references to a CSS class removed, but the class itself persisted? Same for JS functions, view partials, functions, I18n locale keys, routes, etc. Are there sufficient tests to cover the functionality that's been added?
to forget to add view files, support files (eg. test import files), images, etc. to the git repo. Examine the fallout of deletions - were all references to a CSS class removed, but the class itself persisted? Same for JS functions, view partials, functions, I18n locale keys, routes, etc. Are there sufficient tests to cover the functionality that's been added? Are there any public functions that should be made private?
Radical Candor by Kim Scott - feedback should be both personal and direct (see Ian Feather’s blog post). Feedback on a PR can be either positive or negative, but should be meaningful.
Radical Candor by Kim Scott - feedback should be both personal and direct (see Ian Feather’s blog post). Feedback on a PR can be either positive or negative, but should be meaningful. Phrasing critical feedback as questions rather than directives is gentler and less combative.
learn, and you aren’t rubber- stamping code that could be problematic. If the feedback you need to give is pervasive or potentially embarrassing, consider talking to the submitter directly instead of putting the feedback in writing.
learn, and you aren’t rubber- stamping code that could be problematic. If the feedback you need to give is pervasive or potentially embarrassing, consider talking to the submitter directly instead of putting the feedback in writing. Ask yourself if your critical comment/inquiry is adding real value or just picking a nit.