Skip to content

Commit c451a16

Browse files
author
Marek Suchánek
committed
Remove the check for experimental; no longer required
1 parent bdbd13c commit c451a16

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

src/validation.rs

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ mod content {
312312
use crate::validation::IssueReport;
313313
use crate::validation::IssueSeverity;
314314
use log::debug;
315-
use regex::{Regex, RegexBuilder};
315+
use regex::Regex;
316316

317317
const SIMPLE_CONTENT_TESTS: [IssueDefinition; 2] = [
318318
IssueDefinition {
@@ -338,9 +338,6 @@ mod content {
338338
if let Some(abstract_issue) = check_abstract_flag(content) {
339339
reports.push(abstract_issue);
340340
}
341-
if let Some(experimental_issue) = check_experimental_flag(content) {
342-
reports.push(experimental_issue);
343-
}
344341

345342
reports.append(check_metadata_variable(content).as_mut());
346343

@@ -427,32 +424,6 @@ mod content {
427424
None
428425
}
429426
}
430-
431-
/// Check that if the file uses any UI macros, it also contains the :experimental: attribute
432-
fn check_experimental_flag(content: &str) -> Option<IssueReport> {
433-
let ui_macros_regex = Regex::new(r"(?:btn:\[.+\]|menu:\S+\[.+\]|kbd:\[.+\])").unwrap();
434-
let experimental_regex = RegexBuilder::new(r"^:experimental:")
435-
.multi_line(true)
436-
.build()
437-
.unwrap();
438-
439-
if let Some((line_no, _line)) = find_first_occurrence(content, ui_macros_regex) {
440-
if let Some(_experimental) = experimental_regex.find(content) {
441-
// This is fine. The file has both a UI macro and the experimental attribute.
442-
None
443-
} else {
444-
Some(IssueReport {
445-
line_number: Some(line_no),
446-
description:
447-
"The file uses a UI macro but the `:experimental:` attribute is missing.",
448-
severity: IssueSeverity::Error,
449-
})
450-
}
451-
} else {
452-
// No UI macro found, means no issue
453-
None
454-
}
455-
}
456427
}
457428

458429
// This section groups all module requirements;

0 commit comments

Comments
 (0)