Closed pgimalac closed 1 year ago
If we add a comment on EOI, does it work? Maybe that would be preferable? The comment could just say "end-of-input"?
@pgimalac
@tomtau yes it works, that's what I did initially (before seeing the comment from @CAD97 on the issue I linked saying to just add an allow(missing_docs)
)
One thing I'm not sure is whether other builtin rules could appear, for example I have the WHITESPACE
rule in my project, but as I redefined it in my grammar I was able to add a comment. This is the main reason why I think #[allow(missing_docs)]
might be a safer fix.
I think they don't, but if they do, we can see if we can add rustdocs to them? One way to verify is you can use my pest fork as a git dependency, remove that whitespace rule and see if there are any warnings about missing comments?
added the comment to EOL: https://github.com/pest-parser/pest/pull/926 -- if it doesn't work, feel free to reopen this PR to add #[allow(missing_docs)]
upgrade to "2.7.4"
, still get warning
error: missing documentation for a variant
--> rua\src\analyze\annotation\single_annotation_parser.rs:7:10
|
7 | #[derive(Parser)]
| ^^^^^^
|
note: the lint level is defined here
--> rua\src\lib.rs:5:9
|
5 | #![deny(missing_docs)]
| ^^^^^^^^^^^^
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
@attila-lin and your own grammar is all documented?
Yes, I think so. Wonder if anyone have the same situation?
@attila-lin i guess your code is not public, is it? I'm trying to look for some code to reproduce it -- the one posted originally by @librelois doesn't seem to be accessible now: https://git.duniter.org/nodes/rust/duniter-rs/blob/migrate_to_pest/documents/v10/mod.rs#L40
Yes, not public.
I make it pub(crate)
solve this problem. Thank you for your response. @tomtau :blush:
This PR adds
#[allow(missing_docs)]
to theRule
struct in order to fix https://github.com/pest-parser/pest/issues/326.The only element which was missing documentation for me was the
EOI
variant, tell me if you would rather add some hardcoded documentation to that variant.