Skip to content

Zero Waste: Replace Custom Topological AST Validator with Semgrep or Ruff #47

@gowthamrao

Description

@gowthamrao

Problem

crates/codegen/src/topological_validator.rs implements a bespoke static analysis linter. It parses Python source code using rustpython_parser and manually walks the AST to enforce a forbidden_matrix (blocking os.system, subprocess, etc.) to prevent boundary violations.

Solution

Writing custom AST traversal engines in Rust to lint Python code is textbook zero-waste violation. This entire file should be deleted and replaced with declarative Semgrep rules or a custom Ruff plugin, which are significantly faster, industry-standard, and infinitely easier to maintain for static analysis.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions