1
- # Mojo Contributor Guide
1
+ # Mojo contributor guide
2
2
3
3
Welcome to the Mojo community! 🔥 We’re very excited that you’re interested in
4
4
contributing to the project. To help you get started and ensure a smooth
@@ -8,7 +8,7 @@ There are many ways to contribute to the project, from joining the
8
8
[ Discord community] ( https://www.discord.gg/modular ) , to filing bugs, to
9
9
contributing documentation, examples, or code.
10
10
11
- ## Submitting Bugs
11
+ ## Submitting bugs
12
12
13
13
Reporting issues is a great way to contribute to the project. Mojo uses GitHub
14
14
Issues for tracking bugs.
@@ -21,25 +21,25 @@ Also, before opening a new issue, take a moment to search through the already
21
21
submitted issues to avoid creating duplicate issues for the maintainers to
22
22
address.
23
23
24
- ### Writing High-Quality Bugs
24
+ ### Writing high-quality bugs
25
25
26
26
We encourage you to provide as much information about the issue as practical.
27
27
The more details you provide, the faster we can resolve the issue. The following
28
28
is a template of the information that should accompany every submitted issue.
29
29
30
- #### Issue Template
30
+ #### Issue template
31
31
32
32
- ** Summary.** A descriptive summary of the issue.
33
33
- ** Description.** A detailed account of the bug, including what was expected
34
34
and what occurred.
35
- - ** Environment Details .**
35
+ - ** Environment details .**
36
36
- Mojo Compiler Version
37
37
- Operating System version
38
38
- Hardware Specifications
39
- - ** Severity/Frequency .** An assessment of the impact ranging from inconvenience
39
+ - ** Severity/frequency .** An assessment of the impact ranging from inconvenience
40
40
to a blocker.
41
41
42
- ## Contributing to Docs and Examples
42
+ ## Contributing to docs and examples
43
43
44
44
We’re happy to accept pull requests for the docs and examples.
45
45
If your change is any one of the following, please create a pull request and we
@@ -67,7 +67,7 @@ require difficult reviews and rework, or that might get rejected.
67
67
See [ Pull Requests] ( #pull-requests ) for information on creating your first pull
68
68
request.
69
69
70
- ## Contributing to the Standard Library
70
+ ## Contributing to the standard library
71
71
72
72
The standard library team is dedicated to creating a vibrant technical community
73
73
around the Mojo programming language. Our vision includes a diverse and
@@ -84,12 +84,12 @@ For more information on our priorities, see the following documents:
84
84
For technical details on developing for the standard library, see the following
85
85
documents:
86
86
87
- - [ Developing the Standard Library ] ( ./stdlib/docs/development.md ) covers building,
87
+ - [ Developing the standard library ] ( ./stdlib/docs/development.md ) covers building,
88
88
testing, and other information you’ll need to work in the standard library.
89
89
- [ Coding Standards and Style Guide] ( ./stdlib/docs/style-guide.md ) provides
90
90
guidelines for writing code for the standard library.
91
91
92
- ### Accepting Open Source PRs
92
+ ### Accepting open source PRs
93
93
94
94
To ensure a streamlined process, contributors are encouraged to focus on
95
95
enhancements, bug fixes, and optimizations aligned with the library's
@@ -153,7 +153,7 @@ This process is heavily inspired by the process used by several other
153
153
open-source projects. We’ll add more documentation in the future as we gain
154
154
experience with the process.
155
155
156
- ## Pull Requests
156
+ ## Pull requests
157
157
158
158
You can use a pull request to propose a change or bug fix to the Mojo Standard
159
159
Library, Mojo examples, or Mojo documentation. This page gives an overview of
@@ -162,28 +162,122 @@ the process, especially for first-time contributors.
162
162
** Note:** Pull requests should be submitted against the ` nightly ` branch,
163
163
which represents the most recent nightly build.
164
164
165
- ### Pull Request Process
165
+ ### Pull request process
166
166
167
- #### 1. First-time checklist
167
+ #### First-time checklist
168
168
169
169
Before you start your first pull request, please complete this checklist:
170
170
171
171
- Read this entire contributor guide.
172
172
- Read the [ Code of Conduct] ( ./CODE_OF_CONDUCT.md ) .
173
173
174
- #### 2. Evaluate and get buy-in on the change
174
+ #### Evaluate and get buy-in on the change
175
175
176
176
We want to be sure that you spend your time efficiently and prepare changes that
177
177
aren’t controversial and get stuck in long rounds of reviews. See the sections
178
178
on [ Contributing to Docs and Examples] ( #contributing-to-docs-and-examples ) and
179
- [ Contributing to the Standard Library ] ( #contributing-to-the-standard-library )
179
+ [ Contributing to the standard library ] ( #contributing-to-the-standard-library )
180
180
for more details.
181
181
182
- #### 3. Create a pull request
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] ( ./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 =" ./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
183
258
184
259
If your change is one of the improvements described above or it has been
185
260
discussed and agreed upon by the project maintainers, please create a pull
186
- request into the ` nightly ` branch and include the following:
261
+ request into the ` nightly ` branch.
262
+
263
+ First push your changes:
264
+
265
+ ``` bash
266
+ git push -u [your-username] my-fix-pr
267
+ ```
268
+
269
+ You'll see a link to create a PR:
270
+
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] ( images/base-branch.png )
279
+
280
+ Now fill out the details:
187
281
188
282
- A short commit title describing the change.
189
283
- A detailed commit description that includes rationalization for the change
@@ -251,7 +345,7 @@ By making a contribution to this project, I certify that:
251
345
this project or the open source license(s) involved.
252
346
```
253
347
254
- ### Review Time SLA
348
+ ### Review time SLA
255
349
256
350
The team commits to reviewing submitted pull requests within a week of
257
351
submission.
0 commit comments