rigsql_rules/structure/
st09.rs1use rigsql_core::SegmentType;
2
3use crate::rule::{CrawlType, Rule, RuleContext, RuleGroup};
4use crate::violation::LintViolation;
5
6#[derive(Debug, Default)]
12pub struct RuleST09;
13
14impl Rule for RuleST09 {
15 fn code(&self) -> &'static str {
16 "ST09"
17 }
18 fn name(&self) -> &'static str {
19 "structure.join_condition_order"
20 }
21 fn description(&self) -> &'static str {
22 "Join condition column order convention."
23 }
24 fn explanation(&self) -> &'static str {
25 "In a JOIN ... ON clause, the column from the table being joined should appear \
26 on the left side of the comparison for consistency and readability. \
27 This rule is currently a stub and does not produce violations."
28 }
29 fn groups(&self) -> &[RuleGroup] {
30 &[RuleGroup::Structure]
31 }
32 fn is_fixable(&self) -> bool {
33 false
34 }
35
36 fn crawl_type(&self) -> CrawlType {
37 CrawlType::Segment(vec![SegmentType::OnClause])
38 }
39
40 fn eval(&self, _ctx: &RuleContext) -> Vec<LintViolation> {
41 vec![]
43 }
44}
45
46#[cfg(test)]
47mod tests {
48 use super::*;
49 use crate::test_utils::lint_sql;
50
51 #[test]
52 fn test_st09_no_false_positives() {
53 let violations = lint_sql("SELECT * FROM a JOIN b ON a.id = b.id;", RuleST09);
54 assert_eq!(violations.len(), 0);
55 }
56}