Skip to main content

GenericRule

Trait GenericRule 

Source
pub trait GenericRule: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn check_content(
        &self,
        file_path: &Path,
        content: &str,
        lang: &str,
    ) -> Vec<CodeIssue>;
}
Expand description

A language-agnostic code quality rule that works on raw text content.

Kept as fallback for languages without tree-sitter grammar.

Required Methods§

Source

fn name(&self) -> &'static str

Returns the unique identifier for this rule (e.g. "c-goto-abuse").

Source

fn check_content( &self, file_path: &Path, content: &str, lang: &str, ) -> Vec<CodeIssue>

Analyze file content and return detected issues.

Implementors§