Welcome to Brainrot! We're excited that you want to contribute. This document provides guidelines and information for contributing to the project.
By participating in this project, you are expected to uphold our Code of Conduct (follows standard open source practices).
- Fork the repository
- Clone your fork:
git clone https://github.com/yourusername/Brainrot.git
- Create a branch for your changes:
git checkout -b feature/your-feature-name
- C compiler (gcc recommended)
- Flex and Bison
- Valgrind
- Make
make clean
make
The test suite can be run using:
make test
Make run_valgrind_tests.sh
executable:
sudo chmod +x run_valgrind_tests.sh
Run:
./run_valgrind_tests.sh
ast.h
/ast.c
: Abstract Syntax Tree implementationlang.y
: Bison grammar filelang.l
: Flex lexer fileexamples/
: Example Brainrot programstests/
: Test suite
- First, check existing issues and PRs to avoid duplicate work
- Create an issue discussing the feature before implementing
- Follow the existing code style
- Add appropriate tests in
tests/
- Add example usage in
examples/
- All new features must include tests
- Test files go in
tests/
- Expected outputs should be added to
expected_results.json
- Tests should cover:
- Happy path
- Error conditions
- Edge cases
- Update documentation as needed
- Add or update tests
- Ensure all tests pass
- Update CHANGELOG.md if applicable
- Reference any related issues
Example PR format:
## Description
Brief description of changes
## Related Issue
Fixes #<issue_number>
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement
- Use 4 spaces for indentation
- Maximum line length of 80 characters
- Function names use snake_case
- Constants use UPPER_SNAKE_CASE
- Add comments for complex logic
- Include parameter documentation for functions
- Token names should be descriptive
- Use consistent naming patterns for similar concepts
- Document grammar rules with examples
- Keep README.md updated with new features
- Document all public functions
- Include examples for new features
- Use clear, concise language
When filing a bug report, include:
- Brainrot version
- Operating system
- Complete error message
- Minimal reproduction code
- Expected vs actual behavior
If you need help, you can:
- Check existing issues
- Create a new issue with your question
- Add [HELP WANTED] tag for implementation assistance
By contributing, you agree that your contributions will be licensed under the same terms as the main project.
Thank you to all contributors who help make Brainrot better!