rigsql_rules/structure/
st06.rs1use rigsql_core::SegmentType;
2
3use crate::rule::{CrawlType, Rule, RuleContext, RuleGroup};
4use crate::violation::LintViolation;
5
6#[derive(Debug, Default)]
12pub struct RuleST06;
13
14impl Rule for RuleST06 {
15 fn code(&self) -> &'static str {
16 "ST06"
17 }
18 fn name(&self) -> &'static str {
19 "structure.column_order"
20 }
21 fn description(&self) -> &'static str {
22 "Select column order convention."
23 }
24 fn explanation(&self) -> &'static str {
25 "Columns in a SELECT clause should follow a consistent ordering convention. \
26 For example, wildcards and simple columns before aggregate or window functions. \
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::SelectClause])
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_st06_no_false_positives() {
53 let violations = lint_sql("SELECT a, b, COUNT(*) FROM t GROUP BY a, b;", RuleST06);
54 assert_eq!(violations.len(), 0);
55 }
56}