Thank you for your interest in contributing to Candy Crash! This document provides guidelines for contributing to the project.
This project adheres to a Code of Conduct that all contributors are expected to follow. Please read CODE_OF_CONDUCT.adoc before contributing.
-
Fork the repository and create your branch from
main -
Make your changes following our coding standards
-
Write tests for new functionality
-
Update documentation as needed
-
Run the test suite and ensure all tests pass
-
Submit a pull request
We follow the Ruby Style Guide with these conventions:
-
Indentation: 2 spaces (no tabs)
-
Line length: 120 characters maximum
-
Method length: Keep methods under 10 lines when possible
-
Class length: Keep classes focused and under 100 lines
-
Keep controllers thin, models fat
-
Use service objects for complex business logic
-
Follow RESTful routing conventions
-
Use strong parameters for security
-
Write self-documenting code with clear naming
-
All new features must include tests
-
Bug fixes should include regression tests
-
Aim for >80% code coverage
-
Test both happy paths and error cases
# Run all tests
rspec
# Run specific test file
rspec spec/models/user_spec.rb
# Run with coverage report
COVERAGE=true rspec<type>(<scope>): <subject> <body> <footer>
Types:
-
feat: New feature -
fix: Bug fix -
docs: Documentation only -
style: Formatting, missing semicolons, etc. -
refactor: Code restructuring -
test: Adding tests -
chore: Maintenance tasks
Example:
feat(courses): Add course search functionality Implement ransack-based search allowing users to filter courses by title, category, and difficulty level. Closes #123
-
❏ All tests pass (
rspec) -
❏ Code passes linting (
rubocop) -
❏ Security scan passes (
brakeman) -
❏ Documentation updated
-
❏ CHANGELOG.adoc updated (for significant changes)
-
❏ Database migrations tested both up and down
## Description Brief description of changes ## Type of Change - [ ] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation update ## Testing How has this been tested? ## Checklist - [ ] Tests pass - [ ] Code follows style guidelines - [ ] Self-review completed - [ ] Documentation updated
-
Automated checks must pass (CI/CD pipeline)
-
At least one maintainer must approve
-
Security review required for auth/authorization changes
-
Performance impact assessed for database/query changes
Never report security issues via public GitHub issues.
See SECURITY.md for responsible disclosure procedures.
Contributors are recognized in:
-
Git commit history
-
CHANGELOG.adoc for significant contributions
-
README.adoc contributors section (optional)
-
Annual contributor appreciation (if applicable)
-
Open a Discussion for general questions
-
Issue tracker for bugs and feature requests
-
Contact maintainers (see MAINTAINERS.adoc)