-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[fix docs compiler warnings] Examples pallets #14669
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you!
CI fails now because: error: could not compile `pallet-example-offchain-worker` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: missing documentation for an associated function
--> frame/examples/dev-mode/src/lib.rs:45:1
|
45 | #[frame_support::pallet(dev_mode)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> frame/examples/dev-mode/src/lib.rs:28:9
|
28 | #![deny(missing_docs)]
| ^^^^^^^^^^^^
= note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info)
error: could not compile `pallet-dev-mode` (lib) due to previous error
error: missing documentation for an associated function
--> frame/examples/kitchensink/src/lib.rs:46:1
|
46 | #[frame_support::pallet]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> frame/examples/kitchensink/src/lib.rs:28:9
|
28 | #![deny(missing_docs)]
| ^^^^^^^^^^^^
= note: this error originates in the attribute macro `frame_support::pallet` (in Nightly builds, run with -Z macro-backtrace for more info)
error: missing documentation for an associated function
--> frame/examples/kitchensink/src/lib.rs:235:29
|
235 | #[pallet::generate_deposit(pub fn deposit_event)]
| @sam0x17 any advice on how we may be able to fix this? |
So glancing through the dev mode implementation I didn't catch any undocumented items slipping through. Could you open the docs on the item it is complaining about @sacha-l and see if there is an undocumented associated function in the rust docs for that item and if so what it is? |
I think this is related to the same reasons the I wasn't able to fix the warnings mentioned here.
After running What I don't understand is with Rust analyzer running I'm able to verify that the docs for ![]() Same for the ![]() When I hover over the |
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.
awesome good find. I didn't realize the problem was specifically with the dev mode pallet example -- I went digging in dev mode expansion to find stuff that might be missing docs in the expansion (for all dev mode pallets) but lol
Thanks!!!!
@@ -301,11 +315,14 @@ pub mod pallet { | |||
#[pallet::validate_unsigned] | |||
impl<T: Config> ValidateUnsigned for Pallet<T> { | |||
type Call = Call<T>; | |||
fn validate_unsigned(_: TransactionSource, _: &Self::Call) -> TransactionValidity { | |||
|
|||
/// Validates an unsigned transaction. |
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.
Trait functions should not be documented, the trait
definition itself should be.
@@ -242,19 +244,18 @@ pub mod pallet { | |||
/// Submit new price to the list via unsigned transaction. | |||
/// | |||
/// Works exactly like the `submit_price` function, but since we allow sending the | |||
/// transaction without a signature, and hence without paying any fees, | |||
/// we need a way to make sure that only some transactions are accepted. | |||
/// This function can be called only once every `T::UnsignedInterval` blocks. |
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.
If you find a linter that will prohibit people from immaturely wrapping their lines early, I will indefinitely be grateful of you.
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.
If you find a linter that will prohibit people from immaturely wrapping their lines early, I will indefinitely be grateful of you.
💯
bot rebase |
Rebased |
bot rebase |
Rebased |
The CI pipeline was cancelled due to failure one of the required jobs. |
This PR fixes the following 38 compiler warnings when running
RUSTFLAGS="-W missing_docs" cargo check -p pallet-examples
:pallet-example-offchain-worker
(lib) generated 4 warningspallet-example-kitchensink
(lib) generated 11 warningspallet-example-basic
(lib) generated 13 warningspallet-dev-mode
(lib) generated 6 warningspallet-example-split
(lib) generated 4 warnings