Files
SpacetimeDB/clippy.toml
T
Phoebe Goldman fca7c27946 Clippy: forbid println and friends (#305)
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`.
2023-09-20 13:24:26 -04:00

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." },
]