1
0
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:
Emil Ernerfeldt
2023-09-05 14:11:22 +02:00
committed by GitHub
parent 436996b79e
commit 67168be069
12 changed files with 119 additions and 23 deletions

View File

@@ -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