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