|
| 1 | +--- |
| 2 | +sidebar_position: 8 |
| 3 | +--- |
| 4 | + |
| 5 | +# Contributing |
| 6 | + |
| 7 | +:tada: Thank you for being interested in contributing to the OpenMEV project!:tada: |
| 8 | + |
| 9 | +Feel welcome and read the following sections in order to know how to ask |
| 10 | +questions and how to work on something. |
| 11 | + |
| 12 | +We're really glad you're reading this, because we need volunteer developers to |
| 13 | +help this project come to fruition. 👏 |
| 14 | + |
| 15 | +## Pull Requests |
| 16 | + |
| 17 | +The best way to contribute to our projects is with pull requests. Here's a quick |
| 18 | +guide: |
| 19 | + |
| 20 | +1. Fork the repo. |
| 21 | + |
| 22 | +2. Run the tests. We only take pull requests with passing tests. |
| 23 | + |
| 24 | +3. Add a test for your change. Only refactoring and documentation changes |
| 25 | + require no new tests. |
| 26 | + |
| 27 | +4. Make sure to check out the [Style Guide](/contributing#style-guide) and |
| 28 | + ensure that your code complies with the rules. |
| 29 | + |
| 30 | +5. Make the test pass. |
| 31 | + |
| 32 | +6. Commit your changes. |
| 33 | + |
| 34 | +7. Push to your fork and submit a pull request on our `dev` branch. Please |
| 35 | + provide us with some explanation of why you made the changes you made. For |
| 36 | + new features make sure to explain a standard use case to us. |
| 37 | + |
| 38 | +## CI (Github Actions) Tests |
| 39 | + |
| 40 | +We use GitHub Actions to test each PR before it is merged. |
| 41 | + |
| 42 | +When you submit your PR (or later change that code), a CI build will |
| 43 | +automatically be kicked off. A note will be added to the PR, and will indicate |
| 44 | +the current status of the build. |
| 45 | + |
| 46 | +## Style Guide |
| 47 | + |
| 48 | +### Code rules |
| 49 | + |
| 50 | +We always use ESLint and Prettier. To check that your code follows the rules, |
| 51 | +simply run the npm script `yarn lint`. |
| 52 | + |
| 53 | +### Commits rules |
| 54 | + |
| 55 | +For commits it is recommended to use |
| 56 | +[Conventional Commits](https://www.conventionalcommits.org). |
| 57 | + |
| 58 | +Don't worry if it looks complicated, in our repositories, after `git add`, you |
| 59 | +can usually run the npm script `yarn commit` to make many of these steps |
| 60 | +interactive. |
| 61 | + |
| 62 | +Each commit message consists of a **header**, a **body** and a **footer**. The |
| 63 | +**header** has a special format that includes a **type**, a **scope** and a |
| 64 | +**subject**: |
| 65 | + |
| 66 | + <type>(<scope>): <subject> |
| 67 | + <BLANK LINE> |
| 68 | + <body> |
| 69 | + <BLANK LINE> |
| 70 | + <footer> |
| 71 | + |
| 72 | +The **header** is mandatory and the **scope** of the header is optional. |
| 73 | + |
| 74 | +#### Type |
| 75 | + |
| 76 | +The type must be one of the following: |
| 77 | + |
| 78 | +- feat: A new feature |
| 79 | +- fix: A bug fix |
| 80 | +- docs: Documentation only changes |
| 81 | +- style: Changes that do not affect the meaning of the code (white-space, |
| 82 | + formatting, missing semi-colons, etc) |
| 83 | +- refactor: A code change that neither fixes a bug nor adds a feature |
| 84 | + (improvements of the code structure) |
| 85 | +- perf: A code change that improves the performance |
| 86 | +- test: Adding missing or correcting existing tests |
| 87 | +- build: Changes that affect the build system or external dependencies (example |
| 88 | + scopes: gulp, npm) |
| 89 | +- ci: Changes to CI configuration files and scripts (example scopes: travis, |
| 90 | + circle) |
| 91 | +- chore: Other changes that don't modify src or test files |
| 92 | +- revert: Reverts a previous commit |
| 93 | + |
| 94 | +#### Scope |
| 95 | + |
| 96 | +The scope should be the name of the npm package affected (as perceived by the |
| 97 | +person reading the changelog generated from commit messages). |
| 98 | + |
| 99 | +#### Subject |
| 100 | + |
| 101 | +The subject contains a succinct description of the change: |
| 102 | + |
| 103 | +- Use the imperative, present tense: "change" not "changed" nor "changes" |
| 104 | +- Don't capitalize the first letter |
| 105 | +- No dot (.) at the end |
| 106 | + |
| 107 | +#### Body |
| 108 | + |
| 109 | +Just as in the subject, use the imperative, present tense: "change" not |
| 110 | +"changed" nor "changes". The body should include the motivation for the change |
| 111 | +and contrast this with previous behavior. |
| 112 | + |
| 113 | +### Branch rules |
| 114 | + |
| 115 | +- There must be a `main` branch, used only for the releases. |
| 116 | +- There must be a `dev` branch, used to merge all the branches under it. |
| 117 | +- Avoid long descriptive names for long-lived branches. |
| 118 | +- Use kebab-case (no CamelCase). |
| 119 | +- Use grouping tokens (words) at the beginning of your branch names (in a |
| 120 | + similar way to the `type` of commit). |
| 121 | +- Define and use short lead tokens to differentiate branches in a way that is |
| 122 | + meaningful to your workflow. |
| 123 | +- Use slashes to separate parts of your branch names. |
| 124 | +- Remove branch after merge if it is not important. |
| 125 | + |
| 126 | +Examples: |
| 127 | + |
| 128 | +```bash |
| 129 | +git branch -b docs/readme |
| 130 | +git branch -b test/a-feature |
| 131 | +git branch -b feat/sidebar |
| 132 | +git branch -b fix/b-feature |
| 133 | +``` |
0 commit comments