-
-
Notifications
You must be signed in to change notification settings - Fork 28
Add warn(missing_docs)
lint and fix all instances of it
#52
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
Add warn(missing_docs)
lint and fix all instances of it
#52
Conversation
[lints.rust] | ||
missing_docs = "warn" |
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.
This was stabilized in v1.74 (docs).
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 think this is the correct link: https://doc.rust-lang.org/1.74.0/cargo/reference/unstable.html#lints
I can't find much docs on missing_docs
, only found it's mentioned by the rustdoc tool: https://doc.rust-lang.org/rustdoc/write-documentation/what-to-include.html
However, it seems obvious what it does.
protos.sort_by(|a, b| a.cmp(b)); | ||
protos.sort(); |
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.
A no-op suggested by Clippy.
build.rs
Outdated
config.type_attribute(".", "#[allow(clippy::doc_lazy_continuation)]"); | ||
config.type_attribute(".", "#[allow(clippy::empty_docs)]"); | ||
} | ||
|
||
config.type_attribute(".", "#[allow(clippy::doc_lazy_continuation)]"); | ||
config.type_attribute(".", "#[allow(clippy::empty_docs)]"); |
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.
These two are moved out of the serde
block because I think they were placed behind that feature gate by mistake. A second pair of eyes to confirm this understanding would be helpful.
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 ended up putting these back in ccc47d5. I still think they may be incorrectly hidden behind the serde
feature, but am leaving that unchanged in this PR unless someone can confirm.
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 #54 they were successfully used without serde.
pub use crate::connections::wrappers::NodeId; | ||
|
||
pub use crate::connections::wrappers::mesh_channel::MeshChannel; | ||
|
||
pub use crate::connections::wrappers::encoded_data::EncodedMeshPacketData; | ||
pub use crate::connections::wrappers::encoded_data::EncodedToRadioPacket; | ||
pub use crate::connections::wrappers::encoded_data::EncodedToRadioPacketWithHeader; | ||
pub use crate::connections::wrappers::encoded_data::IncomingStreamData; | ||
pub use crate::connections::wrappers::mesh_channel::MeshChannel; | ||
pub use crate::connections::wrappers::NodeId; |
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.
A minor formatting fix.
@@ -1,3 +1,4 @@ | |||
//! A Rust library for communicating with and configuring Meshtastic devices. |
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 pulled this module-level doc from the crate description.
/// NOTE: This error name is misspelled and should be treated as if it is `InvalidDataSize`. | ||
#[error("Trying to send too much data")] | ||
InvalidaDataSize { data_length: usize }, | ||
InvalidaDataSize { |
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.
This is unfortunate, but changing this value from InvalidaDataSize
to InvalidDataSize
would be a breaking change. We could either...
- Do nothing (as I have done here)
- Fix this and publish
v1.7.0
, introducing an insanely easy to fix breaking change in a minor version bump. - Wait until a
v2.0.0
goes out and include that change there
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.
Fixing a typo should not be a big deal, for sure we shouldn't wait for v2.0.0.
I'd like to make a new release in July, let's fix this and publish 1.7.0.
This reverts commit d7edebb.
Summary
Adds the following lint to
Cargo.toml
and corrects all cases of it.Checklist
src/generated
encountered via CI (example).