use serde::{Deserialize, Serialize};
use super::{default_cc_compiler, default_cxx_compiler, default_true, KnownFields};
#[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct CppAnalyzerConfig {
#[serde(default = "default_true")]
pub enabled: bool,
#[serde(default)]
pub include_paths: Vec<String>,
#[serde(default)]
pub pkg_config: Vec<String>,
#[serde(default)]
pub include_path_commands: Vec<String>,
#[serde(default)]
pub src_exclude_dirs: Vec<String>,
#[serde(default = "default_cc_compiler")]
pub cc: String,
#[serde(default = "default_cxx_compiler")]
pub cxx: String,
#[serde(default)]
pub cflags: Vec<String>,
#[serde(default)]
pub cxxflags: Vec<String>,
}
impl Default for CppAnalyzerConfig {
fn default() -> Self {
Self {
enabled: true,
include_paths: Vec::new(),
pkg_config: Vec::new(),
include_path_commands: Vec::new(),
src_exclude_dirs: Vec::new(),
cc: default_cc_compiler(),
cxx: default_cxx_compiler(),
cflags: Vec::new(),
cxxflags: Vec::new(),
}
}
}
#[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct IcppAnalyzerConfig {
#[serde(default = "default_true")]
pub enabled: bool,
#[serde(default)]
pub include_paths: Vec<String>,
#[serde(default)]
pub pkg_config: Vec<String>,
#[serde(default)]
pub include_path_commands: Vec<String>,
#[serde(default)]
pub src_exclude_dirs: Vec<String>,
#[serde(default)]
pub follow_angle_brackets: bool,
#[serde(default)]
pub skip_not_found: bool,
}
impl Default for IcppAnalyzerConfig {
fn default() -> Self {
Self {
enabled: true,
include_paths: Vec::new(),
pkg_config: Vec::new(),
include_path_commands: Vec::new(),
src_exclude_dirs: Vec::new(),
follow_angle_brackets: false,
skip_not_found: false,
}
}
}
#[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct PythonAnalyzerConfig {
#[serde(default = "default_true")]
pub enabled: bool,
}
impl Default for PythonAnalyzerConfig {
fn default() -> Self {
Self { enabled: true }
}
}
#[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct MarkdownAnalyzerConfig {
#[serde(default = "default_true")]
pub enabled: bool,
}
impl Default for MarkdownAnalyzerConfig {
fn default() -> Self {
Self { enabled: true }
}
}
#[derive(Debug, Deserialize, Serialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct TeraAnalyzerConfig {
#[serde(default = "default_true")]
pub enabled: bool,
}
impl Default for TeraAnalyzerConfig {
fn default() -> Self {
Self { enabled: true }
}
}
impl KnownFields for CppAnalyzerConfig {
fn known_fields() -> &'static [&'static str] {
&[
"enabled", "include_paths", "pkg_config", "include_path_commands",
"src_exclude_dirs", "cc", "cxx", "cflags", "cxxflags",
]
}
fn checksum_fields() -> &'static [&'static str] {
&["include_paths", "pkg_config", "include_path_commands", "cc", "cxx", "cflags", "cxxflags"]
}
}
impl KnownFields for IcppAnalyzerConfig {
fn known_fields() -> &'static [&'static str] {
&[
"enabled", "include_paths", "pkg_config", "include_path_commands",
"src_exclude_dirs", "follow_angle_brackets", "skip_not_found",
]
}
fn checksum_fields() -> &'static [&'static str] {
&["include_paths", "pkg_config", "include_path_commands", "follow_angle_brackets", "skip_not_found"]
}
}
impl KnownFields for PythonAnalyzerConfig {
fn known_fields() -> &'static [&'static str] { &["enabled"] }
fn checksum_fields() -> &'static [&'static str] { &[] }
}
impl KnownFields for MarkdownAnalyzerConfig {
fn known_fields() -> &'static [&'static str] { &["enabled"] }
fn checksum_fields() -> &'static [&'static str] { &[] }
}
impl KnownFields for TeraAnalyzerConfig {
fn known_fields() -> &'static [&'static str] { &["enabled"] }
fn checksum_fields() -> &'static [&'static str] { &[] }
}