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

Allow doc comments in mock! macro #102

Merged
merged 2 commits into from
Mar 11, 2020
Merged

Allow doc comments in mock! macro #102

merged 2 commits into from
Mar 11, 2020

Conversation

asomers
Copy link
Owner

@asomers asomers commented Feb 20, 2020

Previously, the build would fail if the mock struct line contained a doc
comment. Now, the build will pass, and doc comments on the struct and
methods will be propagated to the generated code.

Fixes #100

Previously, the build would fail if the mock struct line contained a doc
comment.  Now, the build will pass, and doc comments on the struct and
methods will be propagated to the generated code.

Fixes #100
@MOZGIII
Copy link

MOZGIII commented Feb 20, 2020

Could you rebase this to master so that I can check? I've already updated to 0.6.0, but this branch is still on 0.5.2.

@asomers
Copy link
Owner Author

asomers commented Feb 20, 2020

Whoops! Serves me right for not pulling master before starting development. Try now.

@MOZGIII
Copy link

MOZGIII commented Feb 20, 2020

I managed to run a test, and it looks like there are still issues.

I think you can easily debug locally if you add #![deny(missing_docs)] at https://github.com/asomers/mockall/pull/102/files#diff-42d574447a5f4796e85afa40768d12bc.

My sample:

mod gen {
    #![warn(missing_docs)]
    use super::*;

    mock! {
        /// qwe
        pub Runtime {
            // qwe
            fn mock_workaround_spawn<O: 'static>(&self, future: Pin<Box<dyn Future<Output = O> + Send + 'static>>) {}
        }
        /// qwe
        trait Clone {
            /// qwe
            fn clone(&self) -> Self;
        }
    }
}

cargo expand shows some issues - there are a bunch of those.

@asomers
Copy link
Owner Author

asomers commented Feb 21, 2020

Are you sure? I don't see any problems when I add #![deny(missing_docs)]

@asomers
Copy link
Owner Author

asomers commented Mar 11, 2020

Reviewer timeout; committing.

@asomers asomers merged commit f961a05 into master Mar 11, 2020
@asomers asomers deleted the mock_doc_comments branch March 11, 2020 04:18
@MOZGIII
Copy link

MOZGIII commented Mar 11, 2020

Thanks! Sorry for not responding. I'll open another issue if I still have trouble with the docs.

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.

Allow documentation at mock macro
2 participants