sqruff_lib/core/linter/
common.rs

1use sqruff_lib_core::errors::{SQLBaseError, SQLTemplaterError};
2use sqruff_lib_core::parser::segments::base::ErasedSegment;
3use sqruff_lib_core::templaters::base::TemplatedFile;
4
5/// An object to store the result of a templated file/string.
6///
7/// This is notable as it's the intermediate state between what happens
8/// in the main process and the child processes when running in parallel mode.
9#[derive(Debug, Clone)]
10pub struct RenderedFile {
11    pub templated_file: TemplatedFile,
12    pub templater_violations: Vec<SQLTemplaterError>,
13    pub(crate) filename: String,
14    pub source_str: String,
15}
16
17/// An object to store the result of parsing a string.
18#[derive(Debug, Clone)]
19pub struct ParsedString {
20    pub tree: Option<ErasedSegment>,
21    pub violations: Vec<SQLBaseError>,
22    pub templated_file: TemplatedFile,
23    pub filename: String,
24    pub source_str: String,
25}