mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-06 07:26:43 -04:00
fca7c27946
We've had recurring issues with `println` calls sneaking in where `log` crate macros would be more appropriate. This commit adds a Clippy warning for uses of the global I/O macros, i.e. `print`, `println`, `eprint`, `eprintln` and `dbg`. The lint is disabled by a more-specific `clippy.toml` in the `cli` and `sqltest` crates, as well as using `allow` attributes in `standalone`'s `subscommands` module. Additionally, this commit converts a handful of prints in `core/utils` to `log::info`.
8 lines
1.0 KiB
TOML
8 lines
1.0 KiB
TOML
disallowed-macros = [
|
|
{ path = "std::print", reason = "print blocks on a global mutex for synchronization, and its output cannot be filtered. Use a log macro instead, or apply #[allow(disallowed-macros)] if this is test or CLI code." },
|
|
{ path = "std::println", reason = "println blocks on a global mutex for synchronization, and its output cannot be filtered. Use a log macro instead, or apply #[allow(disallowed-macros)] if this is test or CLI code." },
|
|
{ path = "std::eprint", reason = "eprint blocks on a global mutex for synchronization, and its output cannot be filtered. Use a log macro instead, or apply #[allow(disallowed-macros)] if this is test or CLI code." },
|
|
{ path = "std::eprintln", reason = "eprintln blocks on a global mutex for synchronization, and its output cannot be filtered. Use a log macro instead, or apply #[allow(disallowed-macros)] if this is test or CLI code." },
|
|
{ path = "std::dbg", reason = "dbg is a debugging tool and should never be committed into the repository." },
|
|
]
|