You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+33-3Lines changed: 33 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,11 +58,11 @@ Generally, we want to only use the three primary types defined by the specificat
58
58
59
59
-`feat:` - This should be the most used type, as most work we are doing in the project are new features. Commits using this type will always show up in the Changelog.
60
60
-`fix:` - When fixing a bug, we should use this type. Commits using this type will always show up in the Changelog.
61
-
-`chore:` - The least used type, these are **not** included in the Changelog unless they are breaking changes. But remain useful for an understandable commit history.
61
+
-`chore:` - The least used type, these are __not__ included in the Changelog unless they are breaking changes. But remain useful for an understandable commit history.
62
62
63
63
### Conventional Commits: Breaking Changes
64
64
65
-
Annotating **BREAKING CHANGES** is extremely important to our release process and versioning. To mark a commit as breaking, we add the `!` character after the type, but before the colon. For example:
65
+
Annotating __BREAKING CHANGES__ is extremely important to our release process and versioning. To mark a commit as breaking, we add the `!` character after the type, but before the colon. For example:
66
66
67
67
```
68
68
feat!: Rename nargo build to nargo check (#693)
@@ -94,10 +94,14 @@ The easiest way to do this is to have multiple Conventional Commits while you wo
94
94
95
95
### Reviews
96
96
97
-
For any repository in the noir-lang organization, we require code review & approval by **one** Noir team member before the changes are merged, as enforced by GitHub branch protection. Non-breaking pull requests may be merged at any time. Breaking pull requests should only be merged when the team has general agreement of the changes and is preparing a breaking release.
97
+
For any repository in the noir-lang organization, we require code review & approval by __one__ Noir team member before the changes are merged, as enforced by GitHub branch protection. Non-breaking pull requests may be merged at any time. Breaking pull requests should only be merged when the team has general agreement of the changes and is preparing a breaking release.
98
+
99
+
If your Pull Request involves changes in the docs folder, please add the `documentation` flag and request an approval by a DevRel team member[^1]. An approval from DevRel is not necessary to merge your PR.
98
100
99
101
### With Breaking Changes
100
102
103
+
Breaking changes need to be documented. Please ask for help from a DevRel[^1] team member if this is a problem for any reason. Breaking changes need a mandatory approval from DevRel.
104
+
101
105
Sometimes, we don't merge pull requests with breaking changes immediately upon approval. Since a breaking change will cause Noir to bump to the next "minor" version, we might want to land some fixes in "patch" releases before we begin working on that next breaking version.
102
106
103
107
## Merging
@@ -156,6 +160,7 @@ Before merging, you should mentally review these questions:
156
160
- Is continuous integration passing?
157
161
- Do you have the required amount of approvals?
158
162
- Does anyone else need to be pinged for thoughts?
163
+
- Does it have changes to the docs? If so, did you request an approval from a DevRel[^1] team member?
159
164
- Will this cause problems for our release schedule? For example: maybe a patch release still needs to be published.
160
165
- What details do we want to convey to users in the Changelog?
161
166
@@ -167,11 +172,34 @@ Release Please parses Conventional Commit messages and opens (or updates) a pull
167
172
168
173
When we are ready to release the version, we approve and squash the release pull request into `master`. Release Please will detect this merge and generate the appropriate tags for the release. Additional release steps may be triggered inside the GitHub Action to automate other parts of the release process.
169
174
175
+
### Documentation releases
176
+
177
+
We aim to have every documentation version matching the versions of Noir. However, to avoid unnecessary build time and size to the existent documentation, they aren't currently released alongside the stable releases, and instead are released ad-hoc.
178
+
179
+
Please contact any member of the DevRel[^1] team if you believe a new docs version should be cut.
180
+
181
+
### Cutting a new version of the docs
182
+
183
+
The Noir documentation is versioned according to the [Docusaurus documentation](https://docusaurus.io/docs/versioning). In the `versioned_docs` and `versioned_sidebar` folders you will find the docs and configs for the previous versions. If any change needs to be made to older versions, please do them in this folder.
184
+
185
+
In the docs folder, you'll find the current, unreleased version, which we call `dev`. Any change in this folder will be reflected in the next release of the documentation.
186
+
187
+
While the versioning is intended to be managed by the core maintainers, we feel it's important for external contributors to understand why and how is it maintained. To bump to a new version, run the following command, replacing with the intended version:
188
+
189
+
```bash
190
+
npm run docusaurus docs:version <new_version_tag>
191
+
```
192
+
193
+
This should create a new version by copying the docs folder and the sidebars.js file to the relevant folders, as well as adding this version to versions.json.
194
+
195
+
You can then open a Pull Request according to the the [PR section](#pull-requests)
196
+
170
197
## Changelog
171
198
172
199
Noir's Changelog is automatically managed by Release Please and informed by the Conventional Commits (as discussed above).
173
200
174
201
Given the following commits:
202
+
175
203
-`feat(syntax): Implement String data type (#123)`
176
204
-`chore(ci): Use correct rust version`
177
205
-`fix(optimizer): Compile Boolean to u1`
@@ -200,3 +228,5 @@ Release Please would generate add the following to the Changelog:
200
228
201
229
***optimizer:** Compile Boolean to u1
202
230
```
231
+
232
+
[^1]: Currently, @critesjosh, @catmcgee and @signorecello. For Noir documentation, it is recommended to tag @signorecello
Copy file name to clipboardExpand all lines: docs/docs/language_concepts/01_functions.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,45 @@ fn foo(x : Field, y : pub Field) -> Field {
40
40
Note that a `return` keyword is unneeded in this case - the last expression in a function's body is
41
41
returned.
42
42
43
+
## Main function
44
+
45
+
If you're writing a binary, the `main` function is the starting point of your program. You can pass all types of expressions to it, as long as they have a fixed size at compile time:
46
+
47
+
```rust
48
+
fnmain(x:Field) // this is fine: passing a Field
49
+
fnmain(x: [Field; 2]) // this is also fine: passing a Field with known size at compile-time
50
+
fnmain(x: (Field, bool)) // 👌: passing a (Field, bool) tuple means size 2
51
+
fnmain(x:str<5>) // this is fine, as long as you pass a string of size 5
52
+
53
+
fnmain(x:Vec<Field>) // can't compile, has variable size
54
+
fnmain(x: [Field]) // can't compile, has variable size
0 commit comments