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

feat: Show me warning if artificialtion is empty or I did not use the artificialtion. #170

Open
huang12zheng opened this issue Apr 9, 2023 · 1 comment

Comments

@huang12zheng
Copy link

Feature Request

Motivation

  • Background:
    Since I didn't know much about volo, I did a little exploring.
    I added some entries, but I didn't notice that I added thrift without service.

Proposal

  1. So I want to do a [cargo check or cargo build or something] to remind me that the file I generated for the entry is empty.
    In other word, just give me a warning.
  2. Even, if I don't include the corresponding filename, give me a warning.
  • more info about option 2 in lib.rs
mod gen {
    volo::include_service!("volo_gen.rs");
    volo::include_service!("volo_gen2.rs");  // if I forget add this one
}

pub use gen::volo_gen::*;
pub use gen::volo_gen2::*;
@PureWhiteWu
Copy link
Member

For proposal 1: You can just check if the given entry is empty when calling volo-build, I think that's not hard. Would you like to send a pr for that?

For proposal 2: I'm not quite sure how to get this, to achieve the most accurate way we need to parse the whole crate, and we also know little about how the user want to use volo. For example, the user may not want to include the files in mod gen, rather he/she want to include the files in another mod called thrift_gen, and in that situation what should we do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants