Before creating a new branch, always sync and clean up:
git checkout master
git pull
git branch --merged master | grep -v '^\* \|^ master$' | xargs -r git branch -d
Always run the following commands before committing:
- Fix lint:
bundle exec rubocop -a - Update rubocop todo:
bundle exec rubocop --auto-gen-config - Run tests:
bundle exec rspec
Update CHANGELOG.md for any user-facing change. Add a line at the top under ### Changelog in the format:
* YYYY/MM/DD: Description of change - [@dblock](https://github.com/dblock), [@Copilot](https://github.com/apps/copilot-swe-agent).
- Tests live in
spec/and use RSpec with Fabrication for factories (spec/fabricators/). - Write tests for all new features and bug fixes.
- Requires a local MongoDB instance (see
config/mongoid.yml).
- Ruby style is enforced via RuboCop (
.rubocop.yml). Persistent exceptions live in.rubocop_todo.yml. - Do not add new entries to
.rubocop_todo.ymlfor code you write — fix the offenses instead.
- Never push directly to master — always work on a branch and open a PR.
- Squash commits before merging — one logical commit per PR.