|
| 1 | +# Contributing |
| 2 | + |
| 3 | +We welcome contributions! This document provides guidelines for contributing to JournalAnalysis. |
| 4 | + |
| 5 | +## Submitting Bugs |
| 6 | + |
| 7 | +### Before Submitting |
| 8 | + |
| 9 | +Before submitting a bug report, please do the following: |
| 10 | + |
| 11 | +- **Make sure you're on the latest version.** Your problem may have been solved already. |
| 12 | +- **Try older versions.** If you're on the latest release, try rolling back a few minor versions to help narrow down when the problem first arose. |
| 13 | +- **Search the project's issue tracker** to make sure it's not a known issue. |
| 14 | + |
| 15 | +### Bug Report Contents |
| 16 | + |
| 17 | +Make sure your report includes: |
| 18 | + |
| 19 | +- **Operating system:** Windows? macOS? Linux? Include version details. |
| 20 | +- **R version:** Output from `R.version.string` or `sessionInfo()`. |
| 21 | +- **Package version:** Output from `packageVersion("JournalAnalysis")`. |
| 22 | +- **RStudio version:** If the addin is involved, include your RStudio build. |
| 23 | +- **Installation method:** r-universe, GitHub (`devtools::install_github`), or source. |
| 24 | +- **Steps to reproduce:** Include a minimal example, the command or addin steps you used, and the full output or error message. |
| 25 | + |
| 26 | +## Contributing Changes |
| 27 | + |
| 28 | +### Licensing |
| 29 | + |
| 30 | +By contributing to this project, you agree that your contributions will be licensed under the same terms as the rest of the project (see the `LICENSE` file in the repository root). |
| 31 | + |
| 32 | +- Per-file copyright/license headers are typically not needed. Please don't add your own copyright headers to new files unless the project's license actually requires them. |
| 33 | + |
| 34 | +### Version Control |
| 35 | + |
| 36 | +- **Always make a new branch** for your work, no matter how small. |
| 37 | +- **Don't submit unrelated changes in the same branch/pull request.** |
| 38 | +- **Base your branch on `main`** for new features and most bug fixes. |
| 39 | +- If your PR has been sidelined for a while, **rebase or merge to latest `main`** before resubmitting. |
| 40 | + |
| 41 | +### Code Formatting |
| 42 | + |
| 43 | +- **Follow the style used in the repository.** Consistency with the rest of the project always trumps other considerations. |
| 44 | +- Use snake_case for functions and variables, `<-` for assignment, and 2-space indentation. |
| 45 | + |
| 46 | +### Documentation |
| 47 | + |
| 48 | +Documentation is required for all contributions: |
| 49 | + |
| 50 | +- **Roxygen2 comments** must be created or updated for exported functions. |
| 51 | +- **README or pkgdown docs** should be updated when user-facing behavior changes. |
| 52 | +- **Changelog entry** should credit the contributor when the change is user-visible. |
| 53 | + |
| 54 | +### Tests |
| 55 | + |
| 56 | +Tests are required for all contributions: |
| 57 | + |
| 58 | +- **Bug fixes** must include a test proving the existence of the bug being fixed. |
| 59 | +- **New features** must include tests proving they actually work. |
| 60 | +- Run `devtools::test()` locally before opening a pull request. |
| 61 | + |
| 62 | +## Workflow Example |
| 63 | + |
| 64 | +Here's an example workflow for contributing: |
| 65 | + |
| 66 | +### Preparing Your Fork |
| 67 | + |
| 68 | +1. Fork the repository on GitHub. |
| 69 | +2. Clone your fork: `git clone git@github.com:yourname/JournalAnalysis.git` |
| 70 | +3. `cd JournalAnalysis` |
| 71 | +4. Install development dependencies: `devtools::install_dev_deps()` |
| 72 | +5. Create a branch: `git checkout -b fix-description main` |
| 73 | + |
| 74 | +### Making Your Changes |
| 75 | + |
| 76 | +1. Write tests expecting the correct/fixed functionality; make sure they fail initially. |
| 77 | +2. Implement your changes. |
| 78 | +3. Run tests again: `devtools::test()` |
| 79 | +4. Run a full check: `devtools::check()` |
| 80 | +5. Update documentation as needed. |
| 81 | +6. Commit your changes: `git commit -m "Brief description of changes"` |
| 82 | + |
| 83 | +### Creating Pull Requests |
| 84 | + |
| 85 | +1. Push your branch: `git push origin HEAD` |
| 86 | +2. Visit GitHub and click the "Pull request" button. |
| 87 | +3. In the description field, reference the issue number (if fixing an existing issue) or describe the issue and your fix. |
| 88 | +4. Submit and be patient - maintainers will review when they can. |
| 89 | + |
| 90 | +## Questions? |
| 91 | + |
| 92 | +If you have questions about contributing, please [open an issue](https://github.com/vallenderlab/JournalAnalysis/issues) or contact the maintainers. |
0 commit comments