dropbox / pb-jelly

A protobuf code generation framework for the Rust language developed at Dropbox.
Apache License 2.0
610 stars 25 forks source link

[pb-jelly-gen] Suppress inception lint #116

Closed grahamking closed 2 years ago

grahamking commented 2 years ago

Clippy says:

module has the same name as it's containing module

I think changing this would be a breaking change, because imports would have to change. There's also no obvious better name to use that would work in the general case.

So I silenced the lint.

grahamking commented 2 years ago

@nipunn1313 After (if) this merges, would it be possible to make a new release?

nipunn1313 commented 2 years ago

Ha. Module inception. What a great lint name.

For generated code, it doesn't really make sense to use this lint - so this seems fine. If the proto files being generated have the same name module, then this is expected behavior.

Does it work to suppress it within the LIB_RS_HEADER - might be cleaner to do it at the top of the module next to the other suppressions, rather than on every single module.

@parkertimmerman has ability to make releases. I don't currently think I do.

grahamking commented 2 years ago

Yes, that does indeed work and is much nicer, thanks!

(I realized too late about github's "changes" feature, think I overwrote them, sorry about that)

nipunn1313 commented 2 years ago

I'll merge it! Might be helpful to add a test to pbtest.proto that might lead to module inception - just to make sure this doesn't regress in the future? Maybe something like `pbtest/proto/packages/pbtest/inception/inception.proto ?