pub struct InlineConfig { /* private fields */ }Implementations§
Source§impl InlineConfig
impl InlineConfig
pub fn new() -> Self
Sourcepub fn from_content(content: &str) -> Self
pub fn from_content(content: &str) -> Self
Process all inline comments in the content and return the configuration state
Sourcepub fn from_content_with_code_blocks(
content: &str,
code_blocks: &[(usize, usize)],
) -> Self
pub fn from_content_with_code_blocks( content: &str, code_blocks: &[(usize, usize)], ) -> Self
Process all inline comments in the content with precomputed code blocks.
Sourcepub fn is_rule_disabled(&self, rule_name: &str, line_number: usize) -> bool
pub fn is_rule_disabled(&self, rule_name: &str, line_number: usize) -> bool
Check if a rule is disabled at a specific line
Sourcepub fn disabling_layer(
&self,
rule_name: &str,
line_number: usize,
) -> Option<DisableLayer>
pub fn disabling_layer( &self, rule_name: &str, line_number: usize, ) -> Option<DisableLayer>
Which kind of directive keeps rule_name off at line_number, if any.
A file-wide disable answers first: it decides on its own, so a rule enabled for the file stays enabled however the line below is written. The remaining two layers both merely disable, so the wider one answers, naming the directive a caller would have to remove to see the rule report again.
Sourcepub fn get_disabled_rules(&self, line_number: usize) -> HashSet<String>
pub fn get_disabled_rules(&self, line_number: usize) -> HashSet<String>
Get all disabled rules at a specific line
Sourcepub fn get_rule_config(&self, rule_name: &str) -> Option<&JsonValue>
pub fn get_rule_config(&self, rule_name: &str) -> Option<&JsonValue>
Get configuration overrides for a specific rule from configure-file comments
Sourcepub fn get_all_rule_configs(&self) -> &HashMap<String, JsonValue>
pub fn get_all_rule_configs(&self) -> &HashMap<String, JsonValue>
Get all configuration overrides from configure-file comments
Sourcepub fn export_for_file_index(&self) -> FileIndexExport
pub fn export_for_file_index(&self) -> FileIndexExport
Export the disabled rules data for storage in FileIndex.
Returns (file_disabled_rules, persistent_transitions, line_disabled_rules).
Trait Implementations§
Source§impl Clone for InlineConfig
impl Clone for InlineConfig
Source§fn clone(&self) -> InlineConfig
fn clone(&self) -> InlineConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more