Skip to content

Commit f1bdb7f

Browse files
docs(contributing): add contribution guidelines for the flutter_policy_engine project
1 parent bb31dd7 commit f1bdb7f

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

CONTRIBUTING.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Contributing to flutter_policy_engine
2+
3+
Thank you for your interest in contributing! We welcome contributions from everyone. If you are not a direct collaborator, please follow the **fork-and-pull-request** workflow described below.
4+
5+
## Branch Strategy
6+
7+
- **develop**: All external pull requests must target the `develop` branch. This is where active development happens.
8+
- **main**: The `main` branch is reserved for stable releases. It is updated internally by the maintainers via a pull request from `develop` to `main`.
9+
- **Do not submit pull requests directly to `main`.**
10+
11+
## 1. Prerequisites
12+
13+
- Ensure you have a [GitHub account](https://github.com/).
14+
- Install [Git](https://git-scm.com/) and [Flutter](https://flutter.dev/docs/get-started/install) on your machine.
15+
- Familiarize yourself with our [README.md](./README.md) and project structure.
16+
17+
## 2. Forking the Repository
18+
19+
- Navigate to the [flutter_policy_engine GitHub page](https://github.com/your-org/flutter_policy_engine).
20+
- Click the **Fork** button (top right) to create your own copy of the repository.
21+
22+
## 3. Cloning Your Fork
23+
24+
- Clone your fork to your local machine:
25+
```sh
26+
git clone https://github.com/your-username/flutter_policy_engine.git
27+
cd flutter_policy_engine
28+
```
29+
30+
## 4. Creating a Feature Branch
31+
32+
- Always create a new branch for your work:
33+
```sh
34+
git checkout -b feature/your-feature-name
35+
```
36+
- Use descriptive branch names (e.g., `feature/add-logging`, `fix/null-pointer-issue`).
37+
38+
## 5. Making Changes
39+
40+
- Make your changes in the appropriate files.
41+
- Follow the language and framework conventions (Dart/Flutter best practices).
42+
- Write clear, self-documenting code. Add docstrings for public APIs and explain the "why" in comments if needed.
43+
- Add or update tests for your changes.
44+
45+
## 6. Keeping Your Fork Up to Date
46+
47+
- Sync your fork with the upstream repository to avoid merge conflicts:
48+
```sh
49+
git remote add upstream https://github.com/your-org/flutter_policy_engine.git
50+
git fetch upstream
51+
git merge upstream/develop
52+
```
53+
54+
## 7. Commit Messages
55+
56+
- Write concise, meaningful commit messages.
57+
- Use the present tense (e.g., "Add feature X", "Fix bug Y").
58+
- Group related changes into a single commit when possible.
59+
60+
## 8. Submitting a Pull Request
61+
62+
- Push your branch to your fork:
63+
```sh
64+
git push origin feature/your-feature-name
65+
```
66+
- Go to your fork on GitHub and click **Compare & pull request**.
67+
- **Set the base branch to `develop` in the main repository.**
68+
- Fill out the PR template, describing your changes and referencing any related issues.
69+
- Submit the pull request to the `develop` branch.
70+
71+
## 9. Code Review Process
72+
73+
- Your PR will be reviewed by maintainers.
74+
- Be responsive to feedback and make requested changes.
75+
- Once approved, your PR will be merged into `develop`.
76+
- The `main` branch is updated internally by maintainers via a separate pull request from `develop` to `main`.
77+
78+
## 10. Additional Guidelines
79+
80+
- Ensure all tests pass before submitting your PR.
81+
- Follow our code style and linting rules (see `analysis_options.yaml`).
82+
- Do not include unrelated changes in your PR.
83+
- If your change is significant, consider updating the documentation.
84+
85+
## 11. Contact
86+
87+
If you have questions, open an issue or contact the maintainers via GitHub Discussions or Issues.
88+
89+
---
90+
91+
Thank you for helping make this project better!

0 commit comments

Comments
 (0)