From a73ea6603e0d83a6b5d7a42cf4202e55037199e1 Mon Sep 17 00:00:00 2001 From: Chiragk352 Date: Tue, 30 Jun 2026 13:07:20 +0530 Subject: [PATCH] Add Go and Rust BEC catalog bundles --- becs/README.md | 6 +++--- becs/no-debug-go.bec.yaml | 15 +++++++++++++++ becs/no-debug-rust.bec.yaml | 15 +++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 becs/no-debug-go.bec.yaml create mode 100644 becs/no-debug-rust.bec.yaml diff --git a/becs/README.md b/becs/README.md index 1ae8b48..5e35f70 100644 --- a/becs/README.md +++ b/becs/README.md @@ -17,7 +17,7 @@ becwright import https://raw.githubusercontent.com/DataDave-Dev/becwright/main/b | `no-wildcard-imports.bec.yaml` | Warns about `from x import *` | `warning` | | `no-debugger-js.bec.yaml` | Blocks `debugger;` in JS/TS | `blocking` | | `no-console-log-js.bec.yaml` | Warns about `console.log(...)` in JS/TS | `warning` | +| `no-debug-go.bec.yaml` | Blocks `fmt.Println()` and `panic()` in Go | `blocking` | +| `no-debug-rust.bec.yaml` | Blocks `dbg!()` and `println!()` in Rust | `blocking` | -The Python BECs use `paths: ["src/**/*.py"]` and the JS/TS ones `["**/*.js", -"**/*.ts"]`. After importing, adjust `paths` in your `.bec/rules.yaml` if your -code lives elsewhere. +The Python BECs use `paths: ["src/**/*.py"]`, the JS/TS ones `["**/*.js", "**/*.ts"]`, the Go bundles use `["**/*.go"]`, and the Rust bundles use `["**/*.rs"]`. After importing, adjust `paths` in your `.bec/rules.yaml` if your code lives elsewhere. \ No newline at end of file diff --git a/becs/no-debug-go.bec.yaml b/becs/no-debug-go.bec.yaml new file mode 100644 index 0000000..7c5cffa --- /dev/null +++ b/becs/no-debug-go.bec.yaml @@ -0,0 +1,15 @@ +becwright_bec: 1 +exported_from: https://github.com/DataDave-Dev/becwright +rule: + id: no-debug-go + intent: > + Do not leave debug output or panic calls in Go code. + why_it_matters: > + Debug statements and unexpected panic calls should not reach production. + paths: + - "**/*.go" + severity: blocking +check: + kind: builtin + module: forbid + args: "--pattern 'fmt\\.Println\\s*\\(|panic\\s*\\('" \ No newline at end of file diff --git a/becs/no-debug-rust.bec.yaml b/becs/no-debug-rust.bec.yaml new file mode 100644 index 0000000..683ef6b --- /dev/null +++ b/becs/no-debug-rust.bec.yaml @@ -0,0 +1,15 @@ +becwright_bec: 1 +exported_from: https://github.com/DataDave-Dev/becwright +rule: + id: no-debug-rust + intent: > + Do not leave debug output in Rust code. + why_it_matters: > + Debug macros and leftover println! calls should not reach production. + paths: + - "**/*.rs" + severity: blocking +check: + kind: builtin + module: forbid + args: "--pattern 'dbg!\\s*\\(|println!\\s*\\('" \ No newline at end of file