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

missing documentation through diesel macros #378

Closed
iamsebastian opened this Issue Jul 15, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@iamsebastian
Contributor

iamsebastian commented Jul 15, 2016

As I deny missing docs in my actual project, is it possible, to exclude this behaviour from the diesel macros?

My schema.rs looks like this:

#[allow(missing_docs)]
infer_schema!(dotenv!("DATABASE_URL"));

... but this keeps throwing errors:

<diesel macros>:27:33: 38:53 error: missing documentation for a module
<diesel macros>:27 ( $ ( $ column_name , ) + ) } } pub mod columns {
                                                   ^
<diesel macros>:5:1: 5:71 note: in this expansion of table_body! (defined in <diesel macros>)
src/schema.rs:2:1: 2:40 note: in this expansion of table! (defined in <diesel macros>)
src/schema.rs:2:1: 2:40 note: in this expansion of infer_schema! (defined in src/lib.rs)
src/lib.rs:1:9: 1:21 note: lint level defined here
src/lib.rs:1 #![deny(missing_docs)]
                     ^~~~~~~~~~~~
@sgrif

This comment has been minimized.

Member

sgrif commented Jul 15, 2016

So I can definitely add #[allow(missing_docs)] to the generated module (we already add #[allow] for anything that is a default warning), but it's worth noting that changing #[allow(missing_docs)] to #![allow(missing_docs)] would allow it for the entire schema module, which is probably what you want.

I'm hesitant to make this change because it can very quickly expand to pretty much any lint out there.

@killercup

This comment has been minimized.

Member

killercup commented Jan 1, 2017

Now that we are using macros 1.1 we might be able to generate a bit of documentation for these generated modules (macro_rules macros can't do that), e.g. explaining that/when this code was generated, and add a textual description of the schema and how to use it. This might also be nice when using an IDE that can show descriptions for items.

weiznich added a commit to weiznich/diesel that referenced this issue Apr 6, 2017

Add optinal syntax for documenting code generated by table!
This commit adds optinal syntax to the table! dsl to document the
generated code. It is now possible to add an doc-comment for the
generated module and for each column struct.

This should partially fix diesel-rs#378

weiznich added a commit to weiznich/diesel that referenced this issue May 10, 2017

Add optinal syntax for documenting code generated by table!
This commit adds optional syntax to the table! dsl to document the
generated code. It is now possible to add an doc-comment for the
generated module and for each column struct.

This should partially fix diesel-rs#378

weiznich added a commit to weiznich/diesel that referenced this issue May 10, 2017

Add optional syntax for documenting code generated by table!
This commit adds optional syntax to the table! dsl to document the
generated code. It is now possible to add an doc-comment for the
generated module and for each column struct.

This should partially fix diesel-rs#378

weiznich added a commit to weiznich/diesel that referenced this issue Jun 2, 2017

Add optional syntax for documenting code generated by table!
This commit adds optional syntax to the table! dsl to document the
generated code. It is now possible to add an doc-comment for the
generated module and for each column struct.

This should partially fix diesel-rs#378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment