-
-
Notifications
You must be signed in to change notification settings - Fork 124
fix(graindoc): Add all function parameters to the table, even if missing documentation #2293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marcusroberts
wants to merge
5
commits into
main
Choose a base branch
from
marcus/issue_2281
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c0dedc0
fix(graindoc): Add all function parameters to the table, even if miss…
spotandjake 874c844
chore: Add parameter tests
spotandjake f202019
chore: Update documentation
spotandjake 8f0aa7e
fix: Ensure that stderr is tested seperatly then stdout in graindoc test
spotandjake aa839d0
feat: Add specific error for duplicate labels
spotandjake File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| module ParamDuplicate | ||
|
|
||
| /** | ||
| * @param a: This is the first | ||
| * @param a: This is a duplicate | ||
| */ | ||
| provide let test1 = a => a + a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| module ParamUnknown | ||
|
|
||
| /** | ||
| * @param x: This parameter is documented | ||
| */ | ||
| provide let test2 = a => a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| --- | ||
| title: Params | ||
| --- | ||
|
|
||
| ## Values | ||
|
|
||
| Functions and constants included in the Params module. | ||
|
|
||
| ### Params.**test1** | ||
|
|
||
| ```grain | ||
| test1: (a: Number, b: Number) => Number | ||
| ``` | ||
|
|
||
| Fully documented labeled parameters test. | ||
|
|
||
| Parameters: | ||
|
|
||
| | param | type | description | | ||
| | ----- | -------- | ------------------ | | ||
| | `a` | `Number` | This is the first | | ||
| | `b` | `Number` | This is the second | | ||
|
|
||
| ### Params.**test2** | ||
|
|
||
| ```grain | ||
| test2: ((Number, a), (Number, b)) => Number | ||
| ``` | ||
|
|
||
| Fully documented unlabeled parameters test. | ||
|
|
||
| Parameters: | ||
|
|
||
| | param | type | description | | ||
| | ----- | ------------- | ------------------ | | ||
| | `0` | `(Number, a)` | This is the first | | ||
| | `1` | `(Number, b)` | This is the second | | ||
|
|
||
| ### Params.**test3** | ||
|
|
||
| ```grain | ||
| test3: (a: Number, (Number, a), c: Number) => Number | ||
| ``` | ||
|
|
||
| Fully documented mixed parameters test. | ||
|
|
||
| Parameters: | ||
|
|
||
| | param | type | description | | ||
| | ----- | ------------- | ------------------ | | ||
| | `a` | `Number` | This is the first | | ||
| | `1` | `(Number, a)` | This is the second | | ||
| | `c` | `Number` | This is the third | | ||
|
|
||
| ### Params.**test4** | ||
|
|
||
| ```grain | ||
| test4: (a: Number, ?b: Number) => Number | ||
| ``` | ||
|
|
||
| Optional parameters test. | ||
|
|
||
| Parameters: | ||
|
|
||
| | param | type | description | | ||
| | ----- | -------- | ------------- | | ||
| | `a` | `Number` | This is the a | | ||
| | `?b` | `Number` | This is the b | | ||
|
|
||
| ### Params.**test5** | ||
|
|
||
| ```grain | ||
| test5: (a: Number, b: Number) => Number | ||
| ``` | ||
|
|
||
| No documentation test. | ||
|
|
||
| ### Params.**test6** | ||
|
|
||
| ```grain | ||
| test6: (a: Number, b: Number, c: Number) => Number | ||
| ``` | ||
|
|
||
| Partially documented parameters test. | ||
|
|
||
| Parameters: | ||
|
|
||
| | param | type | description | | ||
| | ----- | -------- | ------------- | | ||
| | `a` | `Number` | This is the a | | ||
| | `b` | `Number` | | | ||
| | `c` | `Number` | This is the c | | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to add this as a warning to the compiler proper. We should start a set of Graindoc warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a noted in discord until #2343, I don't think there's an easy way todo this while using the same handler and printing logic we use in the compiler. I think it's ideal we use the same printing logic so any printing improvements there get reflected back in the grain doc warnings.
Maybe for #2342 the warning handler could be a functor that takes the error types and printing handler allowing us to use it in all of our tooling.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a noted in discord until #2343, I don't think there's an easy way todo this while using the same handler and printing logic we use in the compiler. I think it's ideal we use the same printing logic so any printing improvements there get reflected back in the grain doc warnings.
Maybe for #2342 the warning handler could be a functor that takes the error types and printing handler allowing us to use it in all of our tooling.
Unless you have a better idea I think we should keep the error handling here for now and move with #2342, we can renumber our errors then which shouldn't be a problem as we don't reference the numbers anywhere currently.