-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clippy: dissallow some methods and types #1411
Changes from all commits
54627bc
ea51cad
23931ee
6139719
38aa0dd
ee0c636
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hit this before and would be thankful for the clippy warning. Why can't we enable this warning yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because |
||
"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 = [ | ||
Comment on lines
+45
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hit this so often <3 |
||
"GLB", | ||
"GLTF", | ||
"iOS", | ||
"macOS", | ||
"NaN", | ||
"OBJ", | ||
"sRGB", | ||
"sRGBA", | ||
"WebGL", | ||
] |
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.
what's keeping us from that so far? Too widespread direct use?
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.
Yeah - it is used in a lot of build scripts and tests. We can add clippy exceptions to those files but I didn't want to make this PR too big or controversial in one go