sqruff_lib/core/linter/linting_result.rs
1use crate::core::linter::linted_dir::LintedDir;
2
3#[derive(Debug)]
4pub struct LintingResult {
5 pub paths: Vec<LintedDir>,
6}
7
8impl Default for LintingResult {
9 fn default() -> Self {
10 Self::new()
11 }
12}
13
14impl LintingResult {
15 pub fn new() -> Self {
16 LintingResult { paths: vec![] }
17 }
18
19 /// Add a new `LintedDir` to this result.
20 pub fn add(&mut self, path: LintedDir) -> usize {
21 let idx = self.paths.len();
22 self.paths.push(path);
23 idx
24 }
25}