feat(wdl-lint): support doc comments in MetaSections - #1185
Conversation
613d377 to
31a0eca
Compare
31a0eca to
1bf959e
Compare
| pub fn doc_comments<N: TreeNode>( | ||
| preceding_trivia: impl IntoIterator<Item = N::Token>, | ||
| preceding_trivia: impl DoubleEndedIterator<Item = N::Token>, | ||
| allow_floating: bool, |
There was a problem hiding this comment.
I think this should be consistent instead of decided ad hoc for each node type. I'm not sure which is preferable (always include "floating" doc comments or never), but I think we should pick one and apply that everywhere.
There was a problem hiding this comment.
floating comments are only allowed for preambles, which I think makes sense:
## This is a preamble
version 1.3
## This is a comment for `foo`
task foo {}In that example, the comment on foo is clearly attached to the task definition. The preamble, though, is logically attached to the document and not the version statement, despite us internally treating the version statement as the documented node.
| return; | ||
| } | ||
|
|
||
| // Only check struct definitions for WDL >=1.2 |
There was a problem hiding this comment.
OOS for this PR, but should we start linting <1.2 structs for doc comment presence? They can't have meta sections within spec, but no reason they can't have doc comments.
There was a problem hiding this comment.
sure, I'll make an issue after this is merged
part of #557
Before submitting this PR, please make sure:
For external contributors:
For all contributors:
nextbranch in the sprocket.bio repository (when appropriate).For PRs containing lint rule changes:
RULES.md.crates/wdl-lint/tests/lintsthat covers everypossible diagnostic emitted for the rule within the file where the rule
is implemented.