Skip to content

Support more customization options #55

@beeb

Description

@beeb

Ideally, one would be able to specify which natspec items are required for each of the source items (constructor, enum, error, event, function, modifier, struct, state variable). It would be good to be able to differentiate by visibility.

E.g. one could enforce @notice, disallow @dev, enforce @param but not @return etc.

The defaults should match the spec where possible.

In the TOML, this could look something like:

[variable.internal]
notice = "forbidden"
dev = "required"

[function.public]
dev = "forbidden"
param = "required"
return = "ignored"

So for function we would have tables private, internal, public, external. For variable it would be private, internal, public.

The entries in the table would be notice, dev, param, return at least, where applicable (e.g. structs don't have return). TBD if we make the inheritdoc parameter also configurable with this format.

The possible values would be required (must be present), forbidden (must not be present) or ignored (can be present or not).

In the CLI, these would be flattened, need to check how/if clap can handle this. Maybe can be transposed so that a single argument --notice-required takes a string which is a comma-separated list of source items for which to enforce @notice. figment requires square bracket delimiters for lists so maybe we can also match that.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions