On this page
Go linter using tree-sitter AST parsing to detect library boundary violations including forbidden imports and stdout/logging usage.
#rlsbl.lint.go_ast
#rlsbl.lint.go_ast
Go linter using tree-sitter AST parsing to detect library boundary violations including forbidden imports and stdout/logging usage.
#_node_line
def _node_line(node)Return 1-based line number for a tree-sitter node.
#_check_forbidden_imports
def _check_forbidden_imports(tree, filepath, config)Walk AST for import_declaration nodes (single and grouped).
#_extract_string_content
def _extract_string_content(string_node)Extract the text content from an interpreted_string_literal node.
#_check_stdout
def _check_stdout(tree, filepath, config)Detect fmt.Print, fmt.Fprint to os.Stdout, and os.Stdout.Write() calls.
#_check_entry_points
def _check_entry_points(tree, filepath, config)Detect func main() in package main files.
#scan_imports
def scan_imports(filepath: str) -> list[tuple[str, str, int]]Extract all import paths from a Go source file.
Parses the file with tree-sitter and walks import_declaration nodes to collect every imported package path.
Args:
filepath: absolute path to a .go file.
Returns:
- list of (import_path, filepath, line_number) tuples.
#GoAstLinter
Go linter using tree-sitter AST analysis.
#lint
def lint(self, project_path: str, config: LanguageLintConfig) -> list[LintResult]