Skip to content
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

Added NatSpec support for enum value definitions #9545

Open
lilyanB opened this issue Dec 12, 2024 · 1 comment
Open

Added NatSpec support for enum value definitions #9545

lilyanB opened this issue Dec 12, 2024 · 1 comment
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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

No branches or pull requests

3 participants