-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clippy: dissallow some methods and types (#1411)
* Allow-list some words in our markdown docstrings * Forbid a bunch of macros, functions and types * name the threads * Do not ignore errors * Replace use of std::sync::Mutex with parking_lot::Mutex * Warn on failure to spawn analytics threads instead of panicing
- Loading branch information
Showing
9 changed files
with
89 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,56 @@ | ||
msrv = "1.67" | ||
|
||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros | ||
disallowed-macros = [ | ||
'dbg', | ||
|
||
# TODO(emilk): consider forbidding these to encourage the use of proper log stream, and then explicitly allow legitimate uses | ||
# 'std::eprint', | ||
# 'std::eprintln', | ||
# 'std::print', | ||
# 'std::println', | ||
|
||
# 'std::unimplemented', # generated by ArrowDeserialize derive-macro :( | ||
] | ||
|
||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_methods | ||
disallowed-methods = [ | ||
"std::env::temp_dir", # Use the tempdir crate instead | ||
|
||
# Disabled because of https://github.com/rust-lang/rust-clippy/issues/10406 | ||
# "std::time::Instant::now", # use `instant` crate instead for wasm/web compatability | ||
"std::time::Duration::elapsed", # use `instant` crate instead for wasm/web compatability | ||
"std::time::SystemTime::now", # use `instant` or `time` crates instead for wasm/web compatability | ||
|
||
"std::thread::spawn", # Use `std::thread::Builder` and name the thread | ||
|
||
"sha1::Digest::new", # SHA1 is cryptographically broken | ||
] | ||
|
||
# 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 = [ | ||
# Use the faster & simpler non-poisonable primitives in `parking_lot` instead | ||
"std::sync::Mutex", | ||
"std::sync::RwLock", | ||
"std::sync::Condvar", | ||
# "std::sync::Once", # enabled for now as the `log_once` macro uses it internally | ||
|
||
"ring::digest::SHA1_FOR_LEGACY_USE_ONLY", # SHA1 is cryptographically broken | ||
] | ||
|
||
# Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown | ||
doc-valid-idents = [ | ||
"GLB", | ||
"GLTF", | ||
"iOS", | ||
"macOS", | ||
"NaN", | ||
"OBJ", | ||
"sRGB", | ||
"sRGBA", | ||
"WebGL", | ||
] |
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