mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-04-19 19:56:50 +00:00
Add more checks shown before in list subcommand
This commit is contained in:
parent
f02ea9b065
commit
7ab5523f3c
@ -76,7 +76,7 @@ fn check_line(line: usize, content: String) -> Vec<CheckNotice> {
|
||||
|
||||
if content.contains(" </Bezeichnung>") {
|
||||
result.append(&mut vec![CheckNotice::ErrorWithCode {
|
||||
code: "2023-0001".to_string(),
|
||||
code: "2023-0003".to_string(),
|
||||
description:
|
||||
"Leerzeichen am Ende der Plausibilitätsregel-Bezeichnung (OSTARSUPP-13334)"
|
||||
.to_string(),
|
||||
|
@ -28,6 +28,7 @@ use std::collections::HashSet;
|
||||
use console::style;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::checks::CheckNotice::ErrorWithCode;
|
||||
use crate::checks::{CheckNotice, Checkable};
|
||||
use crate::model::onkostar_editor::OnkostarEditor;
|
||||
use crate::model::requirements::{Requirement, Requires};
|
||||
@ -386,6 +387,24 @@ impl FolderContent for DataForm {
|
||||
|
||||
impl Checkable for DataForm {
|
||||
fn check(&self) -> Vec<CheckNotice> {
|
||||
if self
|
||||
.entries
|
||||
.entry
|
||||
.iter()
|
||||
.filter(|entry| entry.procedure_date_status != "none")
|
||||
.count()
|
||||
== 0
|
||||
{
|
||||
return vec![ErrorWithCode {
|
||||
code: "2023-0002".to_string(),
|
||||
description: format!(
|
||||
"Formular '{}' hat keine Angabe zum Prozedurdatum",
|
||||
self.name
|
||||
),
|
||||
line: None,
|
||||
example: None,
|
||||
}];
|
||||
}
|
||||
vec![]
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::HashSet;
|
||||
|
||||
use crate::checks::CheckNotice::ErrorWithCode;
|
||||
use crate::checks::{CheckNotice, Checkable};
|
||||
use console::style;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -383,6 +384,18 @@ impl FolderContent for Unterformular {
|
||||
|
||||
impl Checkable for Unterformular {
|
||||
fn check(&self) -> Vec<CheckNotice> {
|
||||
if self.hat_unterformulare {
|
||||
return vec![ErrorWithCode {
|
||||
code: "2023-0001".to_string(),
|
||||
description: format!(
|
||||
"Unterformular '{}' mit Markierung 'hat Unterformulare'",
|
||||
self.name
|
||||
),
|
||||
line: None,
|
||||
example: None,
|
||||
}];
|
||||
}
|
||||
|
||||
vec![]
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user