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.
Motivation
there is this foundry issue to use a 3rd-party library lint natspec comments:
right now solar doesn't support natspec, which means that the natspec lints that this 3rd-party supports can't be directly implemented on
forge-lint
.so i thought i'd be a good opportunity to introduce an initial version.
Solution
this proposal adds the required AST types and implements a minimal (naive) parser, which could be then used by the linter to achieve what community asked for in the linked ticket.
Notes
i tried implementing it in a backwards-compatible way, although i believe that the only consumer for the existig
DocComments
may be the wip formatter.obviously this feature has never been a priority, as it's never been in the roadmap + it could have a negative impact on performance and increase the size of the generated AST, so we could gate it under a feature flag.
yul tests are currently failing due to the usage of "non-std" tags. I understand what they do but i wasn't aware of them nor saw them in the official soliditylang spec, so i didn't add support for them (but we could if u think we should)