Skip to content

Commit ee8a30a

Browse files
committed
disallow print macros, use clippy by default
1 parent 129e9c2 commit ee8a30a

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

.clippy.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# disallowed-macros = [
2+
# { path = "std::print", reason = "won't work in WASI" },
3+
# { path = "std::println", reason = "won't work in WASI" },
4+
# { path = "std::eprint", reason = "won't work in WASI" },
5+
# { path = "std::eprintln", reason = "won't work in WASI" },
6+
# ]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,5 +572,6 @@ Cargo.lock
572572

573573
.crates.toml
574574
.crates2.json
575+
575576
# it's not good to accept binary files updates in PRs
576577
/bin

.lapce/settings.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[lapce-rust.checkOnSave]
2+
command = "clippy"

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"rust-analyzer.checkOnSave.command": "clippy"
3+
}

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Deny usage of print and eprint as it won't have same result
2+
// in WASI as if doing in standard program, you must really know
3+
// what you are doing to disable that lint (and you don't know)
4+
#![deny(clippy::print_stdout)]
5+
#![deny(clippy::print_stderr)]
6+
17
use anyhow::Result;
28
use lapce_plugin::{
39
psp_types::{

0 commit comments

Comments
 (0)