-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run clippy for wasm, with own clippy.toml config file
- Loading branch information
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This is used by `scripts/clippy_wasm.sh` so we can forbid some methods that are not available in wasm. | ||
# | ||
# We cannot forbid all these methods in the main `clippy.toml` because of | ||
# https://github.com/rust-lang/rust-clippy/issues/10406 | ||
|
||
msrv = "1.67" | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods | ||
disallowed-methods = [ | ||
"std::time::Instant::now", # use `instant` crate instead for wasm/web compatibility | ||
"std::time::Duration::elapsed", # use `instant` crate instead for wasm/web compatibility | ||
"std::time::SystemTime::now", # use `instant` or `time` crates instead for wasm/web compatibility | ||
] | ||
|
||
# Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown | ||
doc-valid-idents = [ | ||
"GitHub", | ||
"GLB", | ||
"GLTF", | ||
"iOS", | ||
"macOS", | ||
"NaN", | ||
"OBJ", | ||
"PyPI", | ||
"sRGB", | ||
"sRGBA", | ||
"WebGL", | ||
"WebSockets", | ||
"..", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
# This scripts run clippy on the wasm32-unknown-unknown target, | ||
# using a special clippy_wasm.toml config file which forbids a few more things. | ||
|
||
set -eu | ||
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) | ||
cd "$script_path/.." | ||
set -x | ||
|
||
mv clippy.toml clippy.toml.bak | ||
cp clippy_wasm.toml clippy.toml | ||
|
||
function cleanup() | ||
{ | ||
mv clippy.toml.bak clippy.toml | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
cargo cranky --all-features --target wasm32-unknown-unknown --target-dir target_wasm -p re_viewer -- --deny warnings |