-
Notifications
You must be signed in to change notification settings - Fork 2
Allow passing arguments to the rustdoc command #2
Conversation
tests/test_doc.rs
Outdated
extern crate docmatic; | ||
|
||
#[test] | ||
fn test_readme() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, running the lib.rs docs as tests verifies the same behavior as these tests
src/lib.rs
Outdated
.arg("--test") | ||
.arg(documentation); | ||
|
||
for arg in args.iter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought for how to handle this case was to provide an API to wrap rustdoc rather than having people directly call rustdoc.
For example, we might have a builder that looks like
docmatic::Assert::new("README.md")
.library_path(path)
.unwrap()
or
docmatic::Assert::new()
.library_path(path)
.file("README.md")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will say, if this seems like too much work at the moment, I can understand us leaving it as-is for now and then I can later go back in and refactor it.
Another option is we could mark the with
variant as unsafe
or hidden behind an unstable
feature.
My preference on commits. This will keep the history cleaner and make it easier for me to identify things to put in the changelog. With that said, I'm also understanding of people's different levels of experience with git and that some history clean up is enough work that it isn't worth doing (like moving a clippy fix across a major refactoring).
Since this isn't a user-facing feature, I'd prefer it not to be
Since this also isn't user-facing, I'd put this down as a "chore" or "style". Or you could squash it.
For this you could
Personally, I'd just squash this
This is another that I'd personally squash |
I think I worked around the CI failure. Its an old problem that skeptic would also have but I finally have a better workaround than So on next push the build "should" work. |
btw thank you for contributing this and wanting to use docmatic! I hope this ends up working out for you. |
No problem ! I see what you mean, it would indeed be nicer to have a higher-level API for this. I'll propose another implementation with a builder pattern. |
Thanks! I assume you want me to get a release out? |
The latest |
It is now published. |
Hi there,
I was working on porting the
pyo3
documentation to use docmatic (PyO3/pyo3#142), but unfortunately it does not work out of the box since it links to thelibpython
, which may be in a non-standard location.I added the possibility to pass additional arguments to the
rustdoc
command, so that we can in our case pass additional--library-path
flags.The only drawback is that all arguments must have the same type, but it's safe to use
String
everywhere in that case.(I also removed the
glob
dependency since it's not used anywhere...)