Skip to content
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

Improves the docs on derive #142

Merged
merged 4 commits into from
Aug 16, 2023
Merged

Conversation

xd009642
Copy link
Contributor

So I've done a bit of work to improve the derive docs.

I do think another improvement may be to copy the style done in the tokio docs and for some simple examples show how the generated code looks. However, I think fake would benefit less from this compared to tokio (how a runtime is setup for an async application is important to more people). So it may just add unnecessary noise to the docs. I've refrained from doing that but if you think it's an improvement just let me know and I can add it easily 😄

Fixes #138

So I've done a bit of work to improve the derive docs.

I do think another improvement may be to copy the style
done in the tokio docs and for some simple examples
show how the generated code looks. However, I think fake would benefit
less from this compared to tokio (how a runtime is setup for an async
application is important to more people). So it may just add unnecessary
noise to the docs.

I guess an issue should be made for the tuple enums - or maybe there's
another way to do it I need to experiment/read-macro-code more
@cksac
Copy link
Owner

cksac commented Aug 15, 2023

I think showing the expanded code in doc not that useful. we can show more usage of the Dummy attribute,
e.g

  1. type not implement by Faker, A constructor fn attribute for 3rd party types?  #102 (comment)
  2. expr https://github.com/cksac/fake-rs/blob/master/fake/examples/derive.rs#L76
  3. default https://github.com/cksac/fake-rs/blob/master/fake/examples/derive.rs#L85
  4. config vec, https://github.com/cksac/fake-rs/blob/master/fake/examples/derive.rs#L23
  5. non None options, Is there a way to force all Option members to be Some(foo)? #139

@xd009642
Copy link
Contributor Author

For 5. how can that functionality be accessed via the derive? It's not clear from me looking at the issue and there's no related links to jump off of 👀.

And sure I'll start adding these extra bits after work 👍

@cksac
Copy link
Owner

cksac commented Aug 15, 2023

ya, item 5 might belong to general doc

@xd009642
Copy link
Contributor Author

I've addressed 1, 2, 3 and 5. Looking into config vec now

@xd009642
Copy link
Contributor Author

Okay added config vec into the lib.rs module docs, I felt it made more sense there than in the macro docs. It's kind of a weird one I guess it's down to FakeBase that I can't see the tuples in any trait implementations. Sealed traits do have that downside on doc discoverability 😅

Let me know any feedback, and as a side note any idea when the next release will go out? Would like to start using things added in my last PRs without relying on a git dep 👀

@cksac
Copy link
Owner

cksac commented Aug 16, 2023

looks good to me. Next release will be this week.

@cksac cksac merged commit 284f168 into cksac:master Aug 16, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve docs for Dummy derive
2 participants