Skip to content

Commit 03f9d74

Browse files
committed
feat: added linting for flow_settings
1 parent e73dfc5 commit 03f9d74

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

crates/cli/src/analyser/mod.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use crate::parser::{Meta, MetaType, Reader};
1111
use tucana::shared::data_type_identifier::Type;
1212
use tucana::shared::definition_data_type_rule::Config;
1313
use tucana::shared::{DataTypeIdentifier, DefinitionDataType, FlowType, RuntimeFunctionDefinition};
14+
use crate::formatter;
1415

1516
#[derive(Clone)]
1617
pub struct AnalysableDataType {
@@ -492,6 +493,38 @@ impl Analyser {
492493
));
493494
}
494495

496+
for flow_setting in analysable_flow_type.flow_type.settings {
497+
if flow_setting.name.is_empty() {
498+
self.reporter.add_report(Diagnose::new(
499+
flow_setting.identifier.clone(),
500+
original_definition.clone(),
501+
UndefinedTranslation {
502+
translation_field: String::from("flow_setting.name"),
503+
},
504+
));
505+
}
506+
507+
if flow_setting.description.is_empty() {
508+
self.reporter.add_report(Diagnose::new(
509+
flow_setting.identifier.clone(),
510+
original_definition.clone(),
511+
UndefinedTranslation {
512+
translation_field: String::from("flow_setting.description"),
513+
},
514+
));
515+
}
516+
517+
if self.data_type_identifier_exists(flow_setting.data_type_identifier.clone(), -1)
518+
{
519+
self.reporter.add_report(Diagnose::new(
520+
name.clone(),
521+
original_definition.clone(),
522+
UndefinedDataTypeIdentifier { identifier: flow_setting.data_type_identifier },
523+
));
524+
}
525+
526+
}
527+
495528
// Check if flow type identifier already exists
496529
for flow_type in &self.flow_types {
497530
if analysable_flow_type.id == flow_type.id {

0 commit comments

Comments
 (0)