Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added NatSpec support for enum value definitions #9545

Open
lilyanB opened this issue Dec 12, 2024 · 3 comments · May be fixed by #10022
Open

Added NatSpec support for enum value definitions #9545

lilyanB opened this issue Dec 12, 2024 · 3 comments · May be fixed by #10022
Labels
Cmd-forge-doc Command: forge doc first issue A good way to start contributing T-feature Type: feature

Comments

@lilyanB
Copy link

lilyanB commented Dec 12, 2024

Component

Forge

Describe the feature you would like

Currently, solidity doesn't support @param for enums (according to the natspec format). So when generating the documentation with forge doc, there is no way to document each enum variant.
The suggestion is to define a @custom:variant item to describe each enum variant.
Foundry already does something similar with unnamed function params ( see here ).

Additional context

Example of result:

/**
 * @dev Enum representing the status of a transaction
* @custom:variant Pending the transaction is pending
* @custom:variant Done the transaction is done
* @custom:variant Revert the transaction is revert
*/
enum Transaction {
    Pending,
    Done,
    Revert
}

image

@lilyanB lilyanB added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Dec 12, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 12, 2024
@zerosnacks zerosnacks added Cmd-forge-doc Command: forge doc first issue A good way to start contributing and removed T-needs-triage Type: this issue needs to be labelled labels Dec 13, 2024
@emarc99
Copy link

emarc99 commented Dec 21, 2024

Can I start working on this?

@chiscookeke11
Copy link

Is it okay if I take this?

@wengDavo
Copy link

Is this issue still available?

@samooyo samooyo linked a pull request Mar 6, 2025 that will close this issue
3 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Cmd-forge-doc Command: forge doc first issue A good way to start contributing T-feature Type: feature
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

5 participants