Skip to content

Commit 804da64

Browse files
committed
Resolved merge conflicts by accepting all incoming
2 parents 984cf73 + 3090d2b commit 804da64

File tree

236 files changed

+49094
-9258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+49094
-9258
lines changed

CONTRIBUTING.md

+264-26
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,293 @@
1-
# Mojo Contributor Guide
1+
# Mojo contributor guide
22

33
Welcome to the Mojo community! 🔥 We’re very excited that you’re interested in
44
contributing to the project. To help you get started and ensure a smooth
55
process, we’ve put together this contributor guide.
66

7-
## 1. First-time checklist
7+
There are many ways to contribute to the project, from joining the
8+
[Discord community](https://www.discord.gg/modular), to filing bugs, to
9+
contributing documentation, examples, or code.
810

9-
Before you start your first pull request, please complete this checklist:
11+
## Submitting bugs
1012

11-
- Read this entire contributor guide.
12-
- Read the [Code of Conduct](CODE_OF_CONDUCT.md).
13+
Reporting issues is a great way to contribute to the project. Mojo uses GitHub
14+
Issues for tracking bugs.
15+
16+
Keep in mind that bugs with a reproducible test case and well-written supporting
17+
documentation are considered a higher priority. Ensure that reproducible steps
18+
are the smallest possible to maximize contributor time.
19+
20+
Also, before opening a new issue, take a moment to search through the already
21+
submitted issues to avoid creating duplicate issues for the maintainers to
22+
address.
23+
24+
### Writing high-quality bugs
1325

14-
## 2. Evaluate and get buy-in on the change
26+
We encourage you to provide as much information about the issue as practical.
27+
The more details you provide, the faster we can resolve the issue. The following
28+
is a template of the information that should accompany every submitted issue.
1529

16-
We want to be sure that you spend your time efficiently and prepare changes
17-
that aren’t controversial and get stuck in long rounds of reviews.
30+
#### Issue template
1831

32+
- **Summary.** A descriptive summary of the issue.
33+
- **Description.** A detailed account of the bug, including what was expected
34+
and what occurred.
35+
- **Environment details.**
36+
- Mojo Compiler Version
37+
- Operating System version
38+
- Hardware Specifications
39+
- **Severity/frequency.** An assessment of the impact ranging from inconvenience
40+
to a blocker.
41+
42+
## Contributing to docs and examples
43+
44+
We’re happy to accept pull requests for the docs and examples.
1945
If your change is any one of the following, please create a pull request and we
2046
will happily accept it as quickly as possible:
2147

22-
- Code improvement:
48+
- Example code improvement:
2349
- Bug fix
2450
- Performance improvement
2551
- Code readability improvement
26-
- Conformity to style improvement (TODO: publish code style guide)
52+
- Conformity to style improvement
2753
- Documentation improvement:
2854
- Typo fix
2955
- Markup/rendering fix
3056
- Factual information fix
3157
- New factual information for an existing page
3258

33-
Before embarking on any major change, please **create an issue** or **start a
34-
discussion**, so we can collaborate and agree on a solution.
59+
Before embarking on any major change, please **create an issue** or
60+
**start a discussion**, so we can collaborate and agree on a solution.
3561

3662
For example, refactoring an entire code example or adding an entire new page to
3763
the documentation is a lot of work and it might conflict with other work that’s
3864
already in progress. We don’t want you to spend time on something that might
3965
require difficult reviews and rework, or that might get rejected.
4066

41-
## 3. Create a pull request
67+
See [Pull Requests](#pull-requests) for information on creating your first pull
68+
request.
69+
70+
## Contributing to the standard library
71+
72+
The standard library team is dedicated to creating a vibrant technical community
73+
around the Mojo programming language. Our vision includes a diverse and
74+
inclusive environment where developers are motivated to contribute to the growth
75+
of the Mojo package ecosystem with a myriad of community-driven additions.
76+
77+
For more information on our priorities, see the following documents:
78+
79+
- Our [Vision document](./stdlib/docs/vision.md) describes the guiding
80+
principles behind our development efforts.
81+
- Our [Roadmap](./stdlib/docs/roadmap.md) identifies concrete development goals
82+
as we work towards an even more robust and feature-rich standard library.
83+
84+
For technical details on developing for the standard library, see the following
85+
documents:
86+
87+
- [Developing the standard library](./stdlib/docs/development.md) covers building,
88+
testing, and other information you’ll need to work in the standard library.
89+
- [Coding Standards and Style Guide](./stdlib/docs/style-guide.md) provides
90+
guidelines for writing code for the standard library.
91+
92+
### Accepting open source PRs
93+
94+
To ensure a streamlined process, contributors are encouraged to focus on
95+
enhancements, bug fixes, and optimizations aligned with the library's
96+
overarching goals. These guidelines aim to facilitate a collaborative
97+
environment where contributors and the standard library team can work together
98+
effectively toward the continued improvement of Mojo.
99+
100+
#### Changes we *accept*
101+
102+
These changes are uncontroversial, easier to review, and more likely to be
103+
accepted:
104+
105+
- Well-documented bug fixes submitted with code reproducing the issue in a test
106+
or benchmark.
107+
- Performance improvements that don’t sacrifice code readability or
108+
maintainability and are accompanied by benchmarks.
109+
- Improvements to stdlib documentation or that expand on it.
110+
- Improvements to the test coverage.
111+
- Porting of tests from `FileCheck` to using `assert_*` functions from the
112+
`testing` module.
113+
- Changes that address security vulnerabilities.
114+
115+
#### Changes we *avoid*
116+
117+
Changes that don’t align with our vision and roadmap are unlikely to be
118+
accepted. For example:
119+
120+
- Changes that do not align with the published roadmap or the core principles of
121+
the standard library.
122+
- Code without tests—especially for core primitives.
123+
- Changes that break existing API or implicit behavior semantics.
124+
- Changes where the contributors’ favorite feature or system isn’t being used
125+
and they submit a change unilaterally switching the project to use it. For
126+
example, the contributor doesn’t like CMake as a build system and submits a PR
127+
changing the repository to use their favorite build system.
128+
- Adding support for esoteric platforms.
129+
- Adding dependencies to the code base.
130+
- Broad formatting or refactoring changes.
131+
- Changes that need broad community consensus.
132+
- Changes if contributors are not responsive.
133+
- Adding an entire new module without going through the RFC/proposal process.
134+
135+
### Proposals
136+
137+
If you’re interested in making a significant change—one that doesn’t fall into
138+
the list of “Changes we accept,” your first step is a written proposal. The
139+
proposals process ensures feedback from the widest possible set of community
140+
members and serves as an audit log of past proposal changes with most
141+
importantly the rationale behind it.
142+
143+
Proposals consist of a GitHub [Pull Request](#pull-requests) that adds a
144+
document to the [`proposals/`](./proposals) directory. Contributors are
145+
encouraged to react with a *thumbs-up* to proposal PRs if they are generally
146+
interested and supportive of the high-level direction. These are assigned to
147+
Mojo standard library leads to decide. The proposal PR can be merged once the
148+
assigned lead approves, all blocking issues have been decided, and any related
149+
decisions are incorporated. If the leads choose to defer or reject the proposal,
150+
the reviewing lead should explain why and close the PR.
151+
152+
This process is heavily inspired by the process used by several other
153+
open-source projects. We’ll add more documentation in the future as we gain
154+
experience with the process.
155+
156+
## Pull requests
157+
158+
You can use a pull request to propose a change or bug fix to the Mojo Standard
159+
Library, Mojo examples, or Mojo documentation. This page gives an overview of
160+
the process, especially for first-time contributors.
161+
162+
**Note:** Pull requests should be submitted against the `nightly` branch,
163+
which represents the most recent nightly build.
164+
165+
### Pull request process
166+
167+
#### First-time checklist
168+
169+
Before you start your first pull request, please complete this checklist:
170+
171+
- Read this entire contributor guide.
172+
- Read the [Code of Conduct](./CODE_OF_CONDUCT.md).
173+
174+
#### Evaluate and get buy-in on the change
175+
176+
We want to be sure that you spend your time efficiently and prepare changes that
177+
aren’t controversial and get stuck in long rounds of reviews. See the sections
178+
on [Contributing to Docs and Examples](#contributing-to-docs-and-examples) and
179+
[Contributing to the standard library](#contributing-to-the-standard-library)
180+
for more details.
181+
182+
#### Fork and clone the repo
183+
184+
Go to the [Mojo repo](https://github.com/modularml/mojo) and click the fork
185+
button:
186+
187+
![Create Fork](stdlib/docs/images/create-fork.png)
188+
189+
Clone your forked repo locally with the command:
190+
191+
```bash
192+
git clone [email protected]:[your-username]/mojo.git
193+
cd mojo
194+
```
195+
196+
Add the upstream remote and fetch it:
197+
198+
```bash
199+
git remote add upstream [email protected]:modularml/mojo.git
200+
git fetch upstream
201+
```
202+
203+
#### Branching off nightly
204+
205+
Make sure to branch off `nightly` to work on your PR:
206+
207+
```bash
208+
git checkout upstream/nightly
209+
git checkout -b my-fix-pr
210+
```
211+
212+
You should periodically make sure you've synced the latest changes, especially
213+
before raising a PR:
214+
215+
```bash
216+
git fetch upstream
217+
git rebase upstream/nightly
218+
```
219+
220+
#### Getting the nightly Mojo compiler
221+
222+
Now that you're on the nightly branch, you need to install the latest nightly
223+
Mojo compiler:
224+
225+
```bash
226+
curl https://get.modular.com | sh -
227+
228+
modular auth
229+
230+
modular install nightly/mojo
231+
```
232+
233+
If you already have an older `nightly/mojo` compiler, replace
234+
`modular install nightly/mojo` with `modular update nightly/mojo`.
235+
236+
Then, follow the instructions from the `modular` tool in adding the `mojo`
237+
compiler to your `PATH` such as:
238+
239+
```bash
240+
echo export MODULAR_HOME="$HOME/.modular" >> ~/.zshrc
241+
echo 'export PATH="$HOME/.modular/pkg/packages.modular.com_nightly_mojo/bin:$PATH"' >> ~/.zshrc
242+
source ~/.zshrc
243+
```
244+
245+
If you're using bash, replace the three `~/.zshrc` above with `~/.bashrc`.
246+
247+
#### Mojo nightly vscode extension
248+
249+
Install the [Mojo nightly VS Code
250+
extension](https://marketplace.visualstudio.com/items?itemName=modular-mojotools.vscode-mojo-nightly):
251+
252+
<img src="./stdlib/docs/images/nightly-extension.png" width=350 />
253+
254+
You can only have one Mojo extension enabled at a time, remember to switch back
255+
when using the stable release!
256+
257+
#### Create a pull request
42258

43259
If your change is one of the improvements described above or it has been
44260
discussed and agreed upon by the project maintainers, please create a pull
45-
request into the `main` branch and include the following:
261+
request into the `nightly` branch.
46262

47-
- A short commit message.
263+
First push your changes:
48264

49-
- A detailed commit description that includes rationalization for the change
50-
and/or explanation of the problem that it solves, with a link to any relevant
51-
GitHub issues.
265+
```bash
266+
git push -u [your-username] my-fix-pr
267+
```
52268

53-
- A `Signed-off-by` line, as per the [Developer Certificate of
54-
Origin](#signing-your-work).
269+
You'll see a link to create a PR:
55270

56-
**Note:** Documentation changes might not be visible on the website until the
57-
next Mojo release.
271+
```plaintext
272+
remote: Create a pull request for 'my-fix-pr' on GitHub by visiting:
273+
remote: https://github.com/jackos/mojo/pull/new/my-fix-pr
274+
```
275+
276+
Make sure you point it to the `nightly` branch:
277+
278+
![Base Branch](stdlib/docs/images/base-branch.png)
279+
280+
Now fill out the details:
281+
282+
- A short commit title describing the change.
283+
- A detailed commit description that includes rationalization for the change
284+
and/or explanation of the problem that it solves, with a link to any relevant
285+
GitHub issues.
286+
-`Signed-off-by` line, as per the
287+
[Developer Certificate of Origin](#signing-your-work).
288+
289+
**Note:** Accepted changes will generally show up in the release build (or on
290+
the website) for the next *major* release.
58291

59292
Thank you for your contributions! ❤️
60293

@@ -67,11 +300,11 @@ at the end of your commit description message in the form of:
67300
`Signed-off-by: Jamie Smith <[email protected]>`
68301

69302
You must use your real name to contribute (no pseudonyms or anonymous
70-
contributions). If you set your `user.name` and `user.email` git configs, you
71-
can sign your commit automatically with `git commit -s`.
303+
contributions). If you set your `user.name` and `user.email` git configs, you
304+
can sign your commit automatically with `git commit -s`.
72305

73-
Doing so serves as a digital signature in agreement to the following Developer
74-
Certificate of Origin (DCO):
306+
Doing so serves as a digital signature in agreement to the following
307+
Developer Certificate of Origin (DCO):
75308

76309
```text
77310
Developer Certificate of Origin
@@ -111,3 +344,8 @@ By making a contribution to this project, I certify that:
111344
maintained indefinitely and may be redistributed consistent with
112345
this project or the open source license(s) involved.
113346
```
347+
348+
### Review time SLA
349+
350+
The team commits to reviewing submitted pull requests within a week of
351+
submission.

0 commit comments

Comments
 (0)