mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Improve clippy, and add more docs (#3306)
* Silence a few clippy warnings * Use named threads * Remove some deprecated functions * Document Context and Ui fully * Use `parking_lot::Mutex` in `eframe` * Expand clippy.toml files * build fix
This commit is contained in:
@@ -3,8 +3,26 @@
|
||||
# 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 root clippy.toml:
|
||||
|
||||
msrv = "1.67"
|
||||
|
||||
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
|
||||
|
||||
max-fn-params-bools = 2 # TODO(emilk): decrease this to 1
|
||||
|
||||
# https://rust-lang.github.io/rust-clippy/master/index.html#/large_include_file
|
||||
max-include-file-size = 100000
|
||||
|
||||
too-many-lines-threshold = 100
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# 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
|
||||
@@ -17,8 +35,9 @@ disallowed-methods = [
|
||||
|
||||
# https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types
|
||||
disallowed-types = [
|
||||
# Cannot spawn threads on wasm:
|
||||
"std::thread::Builder",
|
||||
{ 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" }, // TODO(emilk): consider banning Path on wasm
|
||||
]
|
||||
|
||||
# Allow-list of words for markdown in dosctrings https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
|
||||
|
||||
Reference in New Issue
Block a user