101 lines
9.2 KiB
TOML
101 lines
9.2 KiB
TOML
disallowed-methods = [
|
|
{ path = "std::fs::read", reason = "use bun_sys::file" },
|
|
{ path = "std::fs::write", reason = "use bun_sys::file" },
|
|
{ path = "std::fs::read_to_string", reason = "use bun_sys::file" },
|
|
{ path = "std::fs::remove_file", reason = "use bun_sys::file" },
|
|
{ path = "std::fs::remove_dir_all", reason = "use bun_sys::dir" },
|
|
{ path = "std::fs::create_dir", reason = "use bun_sys::dir" },
|
|
{ path = "std::fs::create_dir_all", reason = "use bun_sys::dir" },
|
|
{ path = "std::fs::metadata", reason = "use bun_sys::file" },
|
|
{ path = "std::fs::canonicalize", reason = "use bun_paths" },
|
|
{ path = "std::env::var", reason = "use bun_core::env_var" },
|
|
{ path = "std::env::var_os", reason = "use bun_core::env_var" },
|
|
{ path = "std::thread::spawn", reason = "use bun_threading::spawn_named or ThreadPool" },
|
|
{ path = "std::mem::zeroed", reason = "use MaybeUninit; zeroed is UB for most Bun types" },
|
|
{ path = "bun_core::output::pretty_fmt_rt", reason = "const format strings must use pretty_fmt!/write_pretty! (compile-time rewrite); the runtime walk is only for templates built at runtime — allow with justification" },
|
|
{ path = "bun_core::output::pretty_fmt_args", reason = "const format strings must use pretty_fmt!/write_pretty! (compile-time rewrite); the runtime walk is only for templates built at runtime — allow with justification" },
|
|
{ path = "bun_core::output::pretty_fmt_runtime", reason = "const format strings must use pretty_fmt!/write_pretty! (compile-time rewrite); the runtime walk is only for templates built at runtime — allow with justification" },
|
|
{ path = "bun_core::output::pretty", reason = "renders args then tag-walks the rendered bytes (allocates twice, mangles user-controlled '<'); use the pretty! macro — allow only for runtime-built payloads, with justification" },
|
|
{ path = "bun_core::output::prettyln", reason = "renders args then tag-walks the rendered bytes; use the prettyln! macro — allow only for runtime-built payloads, with justification" },
|
|
{ path = "bun_core::output::pretty_errorln", reason = "renders args then tag-walks the rendered bytes; use the pretty_errorln! macro — allow only for runtime-built payloads, with justification" },
|
|
{ path = "bun_core::output::warn", reason = "renders args then tag-walks the rendered bytes; use the warn! macro — allow only for runtime-built payloads, with justification" },
|
|
{ path = "bun_core::output::debug_warn", reason = "renders args then tag-walks the rendered bytes; use the debug_warn! macro — allow only for runtime-built payloads, with justification" },
|
|
{ path = "alloc::string::String::from_utf8", reason = "keep data as bytes; for display use bstr::BStr, for JS-visible strings use bun_core::String::clone_utf8" },
|
|
{ path = "alloc::string::String::from_utf8_lossy", reason = "silently corrupts non-UTF-8 bytes and allocates; keep data as bytes (bstr::BStr for Display)" },
|
|
# == byte/substring search must go through bun_core::strings (highway, runtime-dispatched SIMD) ==
|
|
# libcore's searchers are scalar or compile-time-gated SSE2/NEON (we build with
|
|
# -Ctarget-cpu=nehalem on x64); highway picks AVX2/AVX-512 at runtime. The
|
|
# element-generic forms (`<[u8]>::contains`, `iter().position(|b| ..)`) can't be
|
|
# expressed here and are covered by test/internal/source-lints/byte-search.test.ts.
|
|
{ path = "str::find", reason = "use bun_core::strings::index_of_char / index_of on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::rfind", reason = "use bun_core::strings::last_index_of_char / last_index_of on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::contains", reason = "use bun_core::strings::contains_char / contains on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::split_once", reason = "use bun_core::strings::split_once_char / split_once on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::rsplit_once", reason = "use bun_core::strings::rsplit_once_char / rsplit_once on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::split", reason = "use bun_core::strings::split on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::rsplit", reason = "use bun_core::strings on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::splitn", reason = "use bun_core::strings::split / split_once on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::rsplitn", reason = "use bun_core::strings::rsplit_once on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::split_terminator", reason = "use bun_core::strings::split on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::rsplit_terminator", reason = "use bun_core::strings on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::split_inclusive", reason = "use bun_core::strings::index_of_char in a loop on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::lines", reason = "use bun_core::strings::split(bytes, b\"\\n\") and strip a trailing b'\\r' per field (str::lines does) (highway SIMD)" },
|
|
{ path = "str::matches", reason = "use bun_core::strings on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::rmatches", reason = "use bun_core::strings on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::match_indices", reason = "use bun_core::strings on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::rmatch_indices", reason = "use bun_core::strings on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::replace", reason = "use bun_core::strings::replace_owned on .as_bytes() (highway SIMD)" },
|
|
{ path = "str::replacen", reason = "use bun_core::strings::replace_owned on .as_bytes() (highway SIMD)" },
|
|
{ path = "slice::windows", reason = "substring search must use bun_core::strings::index_of (highway memmem); for genuine sliding-window iteration, #[allow] with a reason" },
|
|
{ path = "memchr::memchr", reason = "use bun_core::strings::index_of_char (highway SIMD)" },
|
|
{ path = "memchr::memchr2", reason = "use bun_core::strings::index_of_any (highway SIMD)" },
|
|
{ path = "memchr::memchr3", reason = "use bun_core::strings::index_of_any (highway SIMD)" },
|
|
{ path = "memchr::memrchr", reason = "use bun_core::strings::last_index_of_char (highway SIMD)" },
|
|
{ path = "memchr::memchr_iter", reason = "use bun_core::strings::index_of_char in a loop (highway SIMD)" },
|
|
{ path = "memchr::memmem::find", reason = "use bun_core::strings::index_of (highway memmem)" },
|
|
{ path = "memchr::memmem::rfind", reason = "use bun_core::strings::last_index_of (highway memrmem)" },
|
|
{ path = "memchr::memmem::find_iter", reason = "use bun_core::strings::index_of in a loop (highway memmem)" },
|
|
{ path = "bstr::ByteSlice::find", reason = "use bun_core::strings::index_of (highway memmem)" },
|
|
{ path = "bstr::ByteSlice::rfind", reason = "use bun_core::strings::last_index_of (highway memrmem)" },
|
|
{ path = "bstr::ByteSlice::find_byte", reason = "use bun_core::strings::index_of_char (highway SIMD)" },
|
|
{ path = "bstr::ByteSlice::rfind_byte", reason = "use bun_core::strings::last_index_of_char (highway SIMD)" },
|
|
{ path = "bstr::ByteSlice::find_char", reason = "use bun_core::strings::index_of_char / index_of (highway SIMD)" },
|
|
{ path = "bstr::ByteSlice::rfind_char", reason = "use bun_core::strings::last_index_of_char / last_index_of (highway SIMD)" },
|
|
{ path = "bstr::ByteSlice::find_byteset", reason = "use bun_core::strings::index_of_any (highway SIMD)" },
|
|
{ path = "bstr::ByteSlice::contains_str", reason = "use bun_core::strings::contains (highway memmem)" },
|
|
{ path = "bstr::ByteSlice::find_iter", reason = "use bun_core::strings::index_of in a loop (highway memmem)" },
|
|
{ path = "bstr::ByteSlice::rfind_iter", reason = "use bun_core::strings::last_index_of in a loop (highway memrmem)" },
|
|
{ path = "bstr::ByteSlice::split_str", reason = "use bun_core::strings::split (highway memmem)" },
|
|
{ path = "bstr::ByteSlice::rsplit_str", reason = "use bun_core::strings (highway memrmem)" },
|
|
{ path = "bstr::ByteSlice::split_once_str", reason = "use bun_core::strings::split_once (highway memmem)" },
|
|
{ path = "bstr::ByteSlice::rsplit_once_str", reason = "use bun_core::strings::rsplit_once (highway memrmem)" },
|
|
{ path = "bstr::ByteSlice::replace", reason = "use bun_core::strings::replace_owned (highway memmem)" },
|
|
]
|
|
|
|
disallowed-types = [
|
|
{ path = "std::sync::Mutex", reason = "use bun_threading::Mutex" },
|
|
{ path = "std::sync::RwLock", reason = "use bun_threading::RwLock" },
|
|
{ path = "parking_lot::Mutex", reason = "use bun_threading::Mutex" },
|
|
{ path = "parking_lot::RwLock", reason = "use bun_threading::RwLock" },
|
|
{ path = "parking_lot::RawMutex", reason = "use bun_threading::Mutex" },
|
|
{ path = "std::collections::HashMap", reason = "use bun_collections (wyhash)" },
|
|
{ path = "std::collections::HashSet", reason = "use bun_collections (wyhash)" },
|
|
{ path = "std::fs::File", reason = "use bun_sys::File" },
|
|
{ path = "std::process::Command", reason = "use bun_core::util::spawn_sync_inherit (CLI helpers) or bun_spawn_sys (full control)" },
|
|
]
|
|
|
|
disallowed-macros = [
|
|
{ path = "std::println", reason = "use bun_core::output" },
|
|
{ path = "std::eprintln", reason = "use bun_core::output" },
|
|
{ path = "std::print", reason = "use bun_core::output" },
|
|
{ path = "std::eprint", reason = "use bun_core::output" },
|
|
{ path = "std::dbg", reason = "remove before commit" },
|
|
]
|
|
|
|
pass-by-value-size-limit = 64
|
|
stack-size-threshold = 131072
|
|
enum-variant-size-threshold = 128
|
|
too-large-for-stack = 4096
|
|
avoid-breaking-exported-api = false
|
|
accept-comment-above-attributes = true
|