Skip to content

Commit

Permalink
Add 'missing_docs' attribute to dummy package (#4992)
Browse files Browse the repository at this point in the history
We want to add linter to the entire node based on a template. Just like
`cargo clippy -- --deny missing_docs`. And we have the error (pasted at
the end).
The dummy crate is used to test whether the WASM toolchain is installed
and working as expected. And for some reason this dummy crate included
as a target for the linter. I added an attribute to pass the check.
```
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/Users/hrls/src/atleta/target/debug/build/atleta-runtime-b15153eff20cbe96/build-script-build` (exit status: 1)
  --- stderr
  Rust WASM target for toolchain stable-aarch64-apple-darwin is not properly installed; please install it!

  Further error information:
  ------------------------------------------------------------
     Compiling dummy-crate v1.0.0 (/var/folders/h1/_5gdnk8901n959lc28fwx8400000gn/T/.tmpUQCLaV)
  error: missing documentation for the crate
   --> src/main.rs:1:1
    |
  1 | fn main() {}
    | ^^^^^^^^^^^^
    |
    = note: requested on the command line with `-D missing-docs`

  error: could not compile `dummy-crate` (bin "dummy-crate") due to 1 previous error
  ------------------------------------------------------------


```

Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
hrls and bkchr authored Jul 17, 2024
1 parent 12f352c commit 72030ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion substrate/utils/wasm-builder/src/prerequisites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ impl<'a> DummyCrate<'a> {
"#,
);

write_file_if_changed(project_dir.join("src/main.rs"), "fn main() {}");
write_file_if_changed(
project_dir.join("src/main.rs"),
"#![allow(missing_docs)] fn main() {}",
);
DummyCrate { cargo_command, temp, manifest_path, target }
}

Expand Down

0 comments on commit 72030ce

Please sign in to comment.