pub struct LintContext<'a> {
pub chart_path: &'a Path,
pub chart_metadata: Option<&'a ChartMetadata>,
pub values: Option<&'a ValuesFile>,
pub helpers: Option<&'a ParsedHelpers>,
pub templates: &'a [ParsedTemplate],
pub files: &'a HashSet<String>,
pub template_value_refs: HashSet<String>,
}Expand description
Context for running lint rules.
Fields§
§chart_path: &'a PathPath to the chart root directory.
chart_metadata: Option<&'a ChartMetadata>Parsed Chart.yaml (if available).
values: Option<&'a ValuesFile>Parsed values.yaml (if available).
helpers: Option<&'a ParsedHelpers>Parsed helper templates.
templates: &'a [ParsedTemplate]All parsed templates.
files: &'a HashSet<String>All files in the chart.
template_value_refs: HashSet<String>All value references found in templates.
Implementations§
Source§impl<'a> LintContext<'a>
impl<'a> LintContext<'a>
Sourcepub fn new(
chart_path: &'a Path,
chart_metadata: Option<&'a ChartMetadata>,
values: Option<&'a ValuesFile>,
helpers: Option<&'a ParsedHelpers>,
templates: &'a [ParsedTemplate],
files: &'a HashSet<String>,
) -> Self
pub fn new( chart_path: &'a Path, chart_metadata: Option<&'a ChartMetadata>, values: Option<&'a ValuesFile>, helpers: Option<&'a ParsedHelpers>, templates: &'a [ParsedTemplate], files: &'a HashSet<String>, ) -> Self
Create a new lint context.
Sourcepub fn has_helper(&self, name: &str) -> bool
pub fn has_helper(&self, name: &str) -> bool
Check if a helper is defined.
Sourcepub fn helper_names(&self) -> Vec<&str>
pub fn helper_names(&self) -> Vec<&str>
Get all defined helper names.
Sourcepub fn template_references(&self) -> HashSet<&str>
pub fn template_references(&self) -> HashSet<&str>
Get all template references (from include/template calls).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LintContext<'a>
impl<'a> RefUnwindSafe for LintContext<'a>
impl<'a> Send for LintContext<'a>
impl<'a> Sync for LintContext<'a>
impl<'a> Unpin for LintContext<'a>
impl<'a> UnwindSafe for LintContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.