|
| 1 | +# Contributing to Linear Algebra |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Linear Algebra project! This document outlines the development workflow and contribution guidelines. |
| 4 | + |
| 5 | +## π **Development Workflow** |
| 6 | + |
| 7 | +### **Branch-Based Development** |
| 8 | + |
| 9 | +We use a branch-based development workflow to maintain code quality and enable collaborative development: |
| 10 | + |
| 11 | +1. **Main Branch Protection**: The `main` branch is protected and requires pull requests |
| 12 | +2. **Feature Branches**: All development happens in feature branches |
| 13 | +3. **Pull Request Reviews**: All changes must be reviewed before merging |
| 14 | +4. **Automated Testing**: All PRs run tests automatically |
| 15 | + |
| 16 | +### **Creating a Feature Branch** |
| 17 | + |
| 18 | +```bash |
| 19 | +# Start from the latest main branch |
| 20 | +git checkout main |
| 21 | +git pull origin main |
| 22 | + |
| 23 | +# Create a new feature branch |
| 24 | +git checkout -b feature/your-feature-name |
| 25 | + |
| 26 | +# Make your changes |
| 27 | +# ... edit files ... |
| 28 | + |
| 29 | +# Commit your changes |
| 30 | +git add . |
| 31 | +git commit -m "Add descriptive commit message" |
| 32 | + |
| 33 | +# Push the branch |
| 34 | +git push origin feature/your-feature-name |
| 35 | +``` |
| 36 | + |
| 37 | +### **Pull Request Process** |
| 38 | + |
| 39 | +1. **Create PR**: Open a pull request from your feature branch to `main` |
| 40 | +2. **Automatic Testing**: GitHub Actions will run tests automatically |
| 41 | +3. **Review Process**: Request review from maintainers |
| 42 | +4. **Address Feedback**: Make changes based on review comments |
| 43 | +5. **Merge**: Once approved, the PR will be merged to main |
| 44 | +6. **Documentation Deployment**: Documentation automatically deploys after merge |
| 45 | + |
| 46 | +## π§ͺ **Testing** |
| 47 | + |
| 48 | +### **Running Tests Locally** |
| 49 | + |
| 50 | +```bash |
| 51 | +# From the repository root |
| 52 | +julia --project=. -e "using Pkg; Pkg.test()" |
| 53 | + |
| 54 | +# Or directly |
| 55 | +julia --project=. test/runtests.jl |
| 56 | +``` |
| 57 | + |
| 58 | +### **Continuous Integration** |
| 59 | + |
| 60 | +Our CI pipeline runs on: |
| 61 | +- **All Pull Requests**: Tests run to verify code quality |
| 62 | +- **Push to Main**: Tests + documentation deployment |
| 63 | + |
| 64 | +**CI Jobs:** |
| 65 | +- **Test Job**: Runs on all PRs and pushes |
| 66 | +- **Deploy Documentation**: Only runs on push to main (after PR merge) |
| 67 | + |
| 68 | +## π **Documentation** |
| 69 | + |
| 70 | +### **Building Documentation Locally** |
| 71 | + |
| 72 | +```bash |
| 73 | +# Build documentation |
| 74 | +julia --project=. docs/make.jl |
| 75 | + |
| 76 | +# Serve documentation locally (if using LiveServer.jl) |
| 77 | +julia --project=. -e "using LiveServer; serve(dir=\"docs/build\")" |
| 78 | +``` |
| 79 | + |
| 80 | +### **Documentation Deployment** |
| 81 | + |
| 82 | +- **Automatic**: Documentation deploys to https://study.fourm.info/linear_algebra/ after PR merge |
| 83 | +- **Cross-Repository**: This repo deploys to a subdirectory of the main study site |
| 84 | +- **Manual Trigger**: Maintainers can trigger manual documentation builds if needed |
| 85 | + |
| 86 | +## ποΈ **Code Standards** |
| 87 | + |
| 88 | +### **Julia Style Guidelines** |
| 89 | + |
| 90 | +- Follow [Julia Style Guide](https://docs.julialang.org/en/v1/manual/style-guide/) |
| 91 | +- Use descriptive function and variable names |
| 92 | +- Add docstrings to all public functions |
| 93 | +- Include examples in docstrings where helpful |
| 94 | + |
| 95 | +### **Documentation Standards** |
| 96 | + |
| 97 | +```julia |
| 98 | +""" |
| 99 | + function_name(param1::Type, param2::Type) -> ReturnType |
| 100 | +
|
| 101 | +Brief description of what the function does. |
| 102 | +
|
| 103 | +# Arguments |
| 104 | +- `param1::Type`: Description of parameter 1 |
| 105 | +- `param2::Type`: Description of parameter 2 |
| 106 | +
|
| 107 | +# Returns |
| 108 | +- `ReturnType`: Description of return value |
| 109 | +
|
| 110 | +# Examples |
| 111 | +```julia |
| 112 | +julia> function_name(value1, value2) |
| 113 | +expected_output |
| 114 | +``` |
| 115 | +""" |
| 116 | +function function_name(param1, param2) |
| 117 | + # Implementation |
| 118 | +end |
| 119 | +``` |
| 120 | + |
| 121 | +### **Commit Message Guidelines** |
| 122 | + |
| 123 | +- Use clear, descriptive commit messages |
| 124 | +- Start with a verb in the imperative mood |
| 125 | +- Keep the first line under 50 characters |
| 126 | +- Add detailed explanation in the body if needed |
| 127 | + |
| 128 | +**Good Examples:** |
| 129 | +``` |
| 130 | +Add matrix projection functions |
| 131 | +Fix bug in rotation matrix calculation |
| 132 | +Update documentation for symbolic functions |
| 133 | +``` |
| 134 | + |
| 135 | +## π **Repository Protection Rules** |
| 136 | + |
| 137 | +The main branch is protected with the following rules: |
| 138 | +- **Require pull request reviews** before merging |
| 139 | +- **Require status checks to pass** before merging |
| 140 | +- **Require branches to be up to date** before merging |
| 141 | +- **Include administrators** in these restrictions |
| 142 | + |
| 143 | +## π **Release Process** |
| 144 | + |
| 145 | +1. **Version Bump**: Update version in `Project.toml` |
| 146 | +2. **Changelog**: Update `CHANGELOG.md` (if present) |
| 147 | +3. **Tag Release**: Create a git tag with the version number |
| 148 | +4. **Documentation**: Ensure documentation is updated and deployed |
| 149 | + |
| 150 | +## π **Issue Reporting** |
| 151 | + |
| 152 | +When reporting bugs or requesting features: |
| 153 | + |
| 154 | +1. **Search Existing Issues**: Check if the issue already exists |
| 155 | +2. **Provide Context**: Include relevant code, error messages, and environment details |
| 156 | +3. **Minimal Example**: Provide a minimal reproducible example |
| 157 | +4. **Expected vs Actual**: Describe what you expected vs what happened |
| 158 | + |
| 159 | +## π **Getting Help** |
| 160 | + |
| 161 | +- **Issues**: Use GitHub Issues for bug reports and feature requests |
| 162 | +- **Discussions**: Use GitHub Discussions for questions and general discussion |
| 163 | +- **Pull Requests**: Use PR comments for code-specific discussions |
| 164 | + |
| 165 | +## π **Recognition** |
| 166 | + |
| 167 | +Contributors will be recognized in: |
| 168 | +- Repository contributors list |
| 169 | +- Documentation acknowledgments |
| 170 | +- Release notes (for significant contributions) |
| 171 | + |
| 172 | +Thank you for contributing to the Linear Algebra project! π |
0 commit comments