|
| 1 | +# Contributing to EfCoreKit |
1 | 2 |
|
| 3 | +Thank you for taking the time to contribute! This guide covers everything you need to go from idea to merged pull request. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Table of Contents |
| 8 | + |
| 9 | +- [Ways to Contribute](#ways-to-contribute) |
| 10 | +- [Before You Start](#before-you-start) |
| 11 | +- [Development Setup](#development-setup) |
| 12 | +- [Branch Strategy](#branch-strategy) |
| 13 | +- [Making Changes](#making-changes) |
| 14 | +- [Running the Tests](#running-the-tests) |
| 15 | +- [Code Style](#code-style) |
| 16 | +- [Commit Messages](#commit-messages) |
| 17 | +- [Pull Request Process](#pull-request-process) |
| 18 | +- [Versioning and Releases](#versioning-and-releases) |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## Ways to Contribute |
| 23 | + |
| 24 | +- **Report a bug** — [Open an issue](https://github.com/Clifftech123/EfCoreKit/issues) with steps to reproduce, expected behaviour, and actual behaviour. |
| 25 | +- **Request a feature** — [Open an issue](https://github.com/Clifftech123/EfCoreKit/issues) describing the use case and what you'd like the API to look like. |
| 26 | +- **Fix a bug or implement a feature** — Fork the repo, make changes on a branch, and submit a pull request. |
| 27 | +- **Improve documentation** — Typos, missing examples, unclear wording — all fixes are welcome. |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Before You Start |
| 32 | + |
| 33 | +For anything beyond a small bug fix or documentation change, **open an issue first**. This lets us agree on the approach before you invest time writing code, and avoids situations where a well-written PR cannot be merged because the design doesn't fit the project's direction. |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Development Setup |
| 38 | + |
| 39 | +### Prerequisites |
| 40 | + |
| 41 | +| Tool | Version | |
| 42 | +|------|---------| |
| 43 | +| .NET SDK | 10.0 or later | |
| 44 | +| Git | Any recent version | |
| 45 | + |
| 46 | +### Getting the code |
| 47 | + |
| 48 | +```bash |
| 49 | +# Fork the repo on GitHub, then clone your fork |
| 50 | +git clone https://github.com/<your-username>/EfCoreKit.git |
| 51 | +cd EfCoreKit |
| 52 | + |
| 53 | +# Add the upstream remote so you can pull future changes |
| 54 | +git remote add upstream https://github.com/Clifftech123/EfCoreKit.git |
| 55 | +``` |
| 56 | + |
| 57 | +### Build |
| 58 | + |
| 59 | +```bash |
| 60 | +dotnet restore |
| 61 | +dotnet build |
| 62 | +``` |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## Branch Strategy |
| 67 | + |
| 68 | +| Branch | Purpose | |
| 69 | +|--------|---------| |
| 70 | +| `master` | Latest stable release — never commit here directly | |
| 71 | +| `develop` | Integration branch — all PRs target this branch | |
| 72 | +| `feature/<name>` | New features | |
| 73 | +| `fix/<name>` | Bug fixes | |
| 74 | +| `docs/<name>` | Documentation-only changes | |
| 75 | + |
| 76 | +**Always branch off `develop`, and open your PR against `develop`.** |
| 77 | + |
| 78 | +```bash |
| 79 | +git fetch upstream |
| 80 | +git checkout -b fix/soft-delete-cascade upstream/develop |
| 81 | +``` |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## Making Changes |
| 86 | + |
| 87 | +1. Create your branch off `develop` (see above). |
| 88 | +2. Make focused, minimal changes — one concern per PR. |
| 89 | +3. Keep the public API backwards-compatible unless you've discussed a breaking change in an issue first. |
| 90 | +4. Do not add features, refactor surrounding code, or clean up unrelated areas as part of a bug fix PR. |
| 91 | +5. Update the relevant `docs/` page if your change affects documented behaviour. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +## Running the Tests |
| 96 | + |
| 97 | +The project uses integration tests (no mocks — tests run against a real in-memory or SQLite database): |
| 98 | + |
| 99 | +```bash |
| 100 | +dotnet test tests/EfCoreKit.Tests.Integration/EfCoreKit.Tests.Integration.csproj --configuration Release |
| 101 | +``` |
| 102 | + |
| 103 | +All tests must pass before a PR can be merged. If you're adding a feature or fixing a bug, add a test that covers the new behaviour. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## Code Style |
| 108 | + |
| 109 | +- Follow the conventions already in the codebase — consistency matters more than any individual preference. |
| 110 | +- Use `var` where the type is obvious from the right-hand side. |
| 111 | +- Prefer expression-bodied members for single-line methods/properties. |
| 112 | +- Use `async`/`await` throughout — no `.Result` or `.Wait()`. |
| 113 | +- No unused `using` directives. |
| 114 | +- No commented-out code. |
| 115 | +- XML doc comments (`///`) are not required unless you are adding a new public API surface. |
| 116 | + |
| 117 | +The project does not currently enforce a formatter tool, so use your judgement to match the surrounding code. |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## Commit Messages |
| 122 | + |
| 123 | +Use the conventional commits style: |
| 124 | + |
| 125 | +``` |
| 126 | +<type>: <short summary in present tense> |
| 127 | +
|
| 128 | +[Optional longer description explaining *why*, not what] |
| 129 | +``` |
| 130 | + |
| 131 | +| Type | Use when | |
| 132 | +|------|----------| |
| 133 | +| `feat` | Adding a new feature | |
| 134 | +| `fix` | Fixing a bug | |
| 135 | +| `docs` | Documentation changes only | |
| 136 | +| `test` | Adding or updating tests | |
| 137 | +| `refactor` | Code change that is neither a fix nor a feature | |
| 138 | +| `chore` | Build system, CI, or tooling changes | |
| 139 | + |
| 140 | +Examples: |
| 141 | + |
| 142 | +``` |
| 143 | +feat: add WhereIfNotEmpty extension method |
| 144 | +fix: restore clears DeletedBy when soft-delete interceptor is enabled |
| 145 | +docs: add cascade soft delete example to soft-delete guide |
| 146 | +``` |
| 147 | + |
| 148 | +--- |
| 149 | + |
| 150 | +## Pull Request Process |
| 151 | + |
| 152 | +1. Ensure your branch is up to date with `upstream/develop` before opening the PR. |
| 153 | +2. Fill in the PR description — what changed, why, and how to test it. |
| 154 | +3. All CI checks (build + tests) must pass. |
| 155 | +4. At least one maintainer review is required before merge. |
| 156 | +5. Squash commits if the history is noisy — a clean history per PR is preferred. |
| 157 | +6. Once approved, a maintainer will merge into `develop`. |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +## Code of Conduct |
| 162 | + |
| 163 | +Be respectful. Constructive criticism of code and design is welcome; personal criticism is not. We want this to be a project where everyone feels comfortable contributing. |
| 164 | + |
| 165 | +If you experience or witness unacceptable behaviour, please open a private issue or contact the maintainer directly. |
0 commit comments