-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
211 additions
and
10 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,79 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
# | ||
# There is also a scripts/clippy_wasm/clippy.toml which forbids some methods that are not available in wasm. | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Section identical to scripts/clippy_wasm/clippy.toml: | ||
|
||
msrv = "1.73" | ||
|
||
allow-unwrap-in-tests = true | ||
|
||
# https://doc.rust-lang.org/nightly/clippy/lint_configuration.html#avoid-breaking-exported-api | ||
# We want suggestions, even if it changes public API. | ||
avoid-breaking-exported-api = false | ||
|
||
excessive-nesting-threshold = 8 | ||
|
||
max-fn-params-bools = 1 | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#/large_include_file | ||
max-include-file-size = 1000000 | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#/large_stack_frames | ||
stack-size-threshold = 512000 | ||
|
||
too-many-lines-threshold = 200 | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros | ||
disallowed-macros = ['dbg'] | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods | ||
disallowed-methods = [ | ||
{ path = "egui_extras::TableBody::row", reason = "`row` doesn't scale. Use `rows` instead." }, | ||
{ path = "glam::Vec2::normalize", reason = "normalize() can create NaNs. Use try_normalize or normalize_or_zero" }, | ||
{ path = "glam::Vec3::normalize", reason = "normalize() can create NaNs. Use try_normalize or normalize_or_zero" }, | ||
{ path = "sha1::Digest::new", reason = "SHA1 is cryptographically broken" }, | ||
{ path = "std::env::temp_dir", reason = "Use the tempdir crate instead" }, | ||
{ path = "std::panic::catch_unwind", reason = "We compile with `panic = 'abort'`" }, | ||
{ path = "std::thread::spawn", reason = "Use `std::thread::Builder` and name the thread" }, | ||
|
||
# There are many things that aren't allowed on wasm, | ||
# but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406) | ||
# so we do that in `scripts/clippy_wasm/clippy.toml` instead. | ||
] | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names | ||
disallowed-names = [] | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types | ||
disallowed-types = [ | ||
{ path = "ring::digest::SHA1_FOR_LEGACY_USE_ONLY", reason = "SHA1 is cryptographically broken" }, | ||
|
||
{ path = "std::sync::Condvar", reason = "Use parking_lot instead" }, | ||
{ path = "std::sync::Mutex", reason = "Use parking_lot instead" }, | ||
{ path = "std::sync::RwLock", reason = "Use parking_lot instead" }, | ||
|
||
# "std::sync::Once", # enabled for now as the `log_once` macro uses it internally | ||
] | ||
|
||
# Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown | ||
doc-valid-idents = [ | ||
# You must also update the same list in `scripts/clippy_wasm/clippy.toml`! | ||
"GitHub", | ||
"GLB", | ||
"GLTF", | ||
"iOS", | ||
"macOS", | ||
"NaN", | ||
"OBJ", | ||
"OpenGL", | ||
"PyPI", | ||
"sRGB", | ||
"sRGBA", | ||
"WebGL", | ||
"WebSocket", | ||
"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
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
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
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,75 @@ | ||
# Copied from https://github.com/rerun-io/rerun_template | ||
|
||
# This is used by the CI 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 | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Section identical to the main clippy.toml: | ||
|
||
msrv = "1.73" | ||
|
||
allow-unwrap-in-tests = true | ||
|
||
# https://doc.rust-lang.org/nightly/clippy/lint_configuration.html#avoid-breaking-exported-api | ||
# We want suggestions, even if it changes public API. | ||
avoid-breaking-exported-api = false | ||
|
||
excessive-nesting-threshold = 8 | ||
|
||
max-fn-params-bools = 1 | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#/large_include_file | ||
max-include-file-size = 1000000 | ||
|
||
too-many-lines-threshold = 200 | ||
|
||
# ----------------------------------------------------------------------------- | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods | ||
disallowed-methods = [ | ||
{ path = "crossbeam::channel::Receiver::into_iter", reason = "Cannot block on Web" }, | ||
{ path = "crossbeam::channel::Receiver::iter", reason = "Cannot block on Web" }, | ||
{ path = "crossbeam::channel::Receiver::recv_timeout", reason = "Cannot block on Web" }, | ||
{ path = "crossbeam::channel::Receiver::recv", reason = "Cannot block on Web" }, | ||
{ path = "poll_promise::Promise::block_and_take", reason = "Cannot block on Web" }, | ||
{ path = "poll_promise::Promise::block_until_ready_mut", reason = "Cannot block on Web" }, | ||
{ path = "poll_promise::Promise::block_until_ready", reason = "Cannot block on Web" }, | ||
{ path = "rayon::spawn", reason = "Cannot spawn threads on wasm" }, | ||
{ path = "std::sync::mpsc::Receiver::into_iter", reason = "Cannot block on Web" }, | ||
{ path = "std::sync::mpsc::Receiver::iter", reason = "Cannot block on Web" }, | ||
{ path = "std::sync::mpsc::Receiver::recv_timeout", reason = "Cannot block on Web" }, | ||
{ path = "std::sync::mpsc::Receiver::recv", reason = "Cannot block on Web" }, | ||
{ path = "std::thread::spawn", reason = "Cannot spawn threads on wasm" }, | ||
{ path = "std::time::Duration::elapsed", reason = "use `web-time` crate instead for wasm/web compatibility" }, | ||
{ path = "std::time::Instant::now", reason = "use `web-time` crate instead for wasm/web compatibility" }, | ||
{ path = "std::time::SystemTime::now", reason = "use `web-time` or `time` crates instead for wasm/web compatibility" }, | ||
] | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types | ||
disallowed-types = [ | ||
{ path = "instant::SystemTime", reason = "Known bugs. Use web-time." }, | ||
{ path = "std::thread::Builder", reason = "Cannot spawn threads on wasm" }, | ||
# { path = "std::path::PathBuf", reason = "Can't read/write files on web" }, // Used in build.rs files (which is fine). | ||
] | ||
|
||
# Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown | ||
doc-valid-idents = [ | ||
# You must also update the same list in the root `clippy.toml`! | ||
"..", | ||
"GitHub", | ||
"GLB", | ||
"GLTF", | ||
"iOS", | ||
"macOS", | ||
"NaN", | ||
"OBJ", | ||
"OpenGL", | ||
"PyPI", | ||
"sRGB", | ||
"sRGBA", | ||
"WebGL", | ||
"WebSocket", | ||
"WebSockets", | ||
] |