use std::sync::Arc;
use sqruff_lib_core::errors::SQLFluffUserError;
use sqruff_lib_core::templaters::base::TemplatedFile;
use crate::cli::formatters::Formatter;
use crate::core::config::FluffConfig;
use crate::templaters::placeholder::PlaceholderTemplater;
use crate::templaters::raw::RawTemplater;
#[cfg(feature = "python")]
use crate::templaters::python::PythonTemplater;
pub mod placeholder;
#[cfg(feature = "python")]
pub mod python;
pub mod raw;
pub static RAW_TEMPLATER: RawTemplater = RawTemplater;
pub static PLACEHOLDER_TEMPLATER: PlaceholderTemplater = PlaceholderTemplater;
#[cfg(feature = "python")]
pub static PYTHON_TEMPLATER: PythonTemplater = PythonTemplater;
#[cfg(feature = "python")]
pub static TEMPLATERS: [&'static dyn Templater; 3] =
[&RAW_TEMPLATER, &PLACEHOLDER_TEMPLATER, &PYTHON_TEMPLATER];
#[cfg(not(feature = "python"))]
pub static TEMPLATERS: [&'static dyn Templater; 2] = [&RAW_TEMPLATER, &PLACEHOLDER_TEMPLATER];
pub trait Templater: Send + Sync {
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn process(
&self,
in_str: &str,
f_name: &str,
config: Option<&FluffConfig>,
formatter: &Option<Arc<dyn Formatter>>,
) -> Result<TemplatedFile, SQLFluffUserError>;
}