Skip to main content

specfold_core/check/
rules.rs

1//! The rule catalog, one module per family.
2
3mod asset_refs;
4mod assets;
5mod attachments;
6mod cites;
7mod commands;
8mod counts;
9mod drift;
10mod forbid;
11mod guarded;
12mod hidden;
13mod ids;
14mod lifecycle;
15mod links;
16mod machine_paths;
17mod pins;
18mod placement;
19mod schema;
20mod secrets;
21mod sections;
22mod translations;
23pub use lifecycle::{is_date, overdue_exceptions};
24pub use schema::unknown_key;
25mod md_links;
26pub(crate) mod support;
27mod values;
28mod visibility;
29
30use super::rule::Rule;
31
32pub fn catalog() -> Vec<Box<dyn Rule>> {
33    vec![
34        Box::new(schema::Frontmatter),
35        Box::new(schema::IdMatchesPath),
36        Box::new(schema::Placement),
37        Box::new(schema::StatusAllowed),
38        Box::new(schema::Dates),
39        Box::new(schema::RequiredByStatus),
40        Box::new(sections::RequiredSections),
41        Box::new(values::RequiredValues),
42        Box::new(ids::UniqueIds),
43        Box::new(ids::AliasesClean),
44        Box::new(ids::AliasTableFrozen),
45        Box::new(links::LinksResolve),
46        Box::new(links::NoPathCites),
47        Box::new(links::RelationsResolve),
48        Box::new(links::AnchorsUnique),
49        Box::new(links::GovernsExists),
50        Box::new(md_links::LocalLinks),
51        Box::new(md_links::ImageAlt),
52        Box::new(cites::CitesOutside),
53        Box::new(lifecycle::SupersedePairs),
54        Box::new(lifecycle::ForwardOnly),
55        Box::new(lifecycle::Sealed),
56        Box::new(lifecycle::UpdatedMoves),
57        Box::new(visibility::NotInPublic),
58        Box::new(visibility::NoLocalCites),
59        Box::new(visibility::ExternalCites),
60        Box::new(placement::OwnerMatches),
61        Box::new(attachments::Registered),
62        Box::new(attachments::SizeLimit),
63        Box::new(attachments::HashesMatch),
64        Box::new(attachments::StoredExist),
65        Box::new(forbid::Forbidden),
66        Box::new(commands::VerifyPasses),
67        Box::new(commands::VerifyDeclared),
68        Box::new(commands::GeneratedInSync),
69        Box::new(guarded::GuardsPass),
70        Box::new(secrets::NoSecrets),
71        Box::new(drift::GovernedCodeDrift),
72        Box::new(assets::AssetFrontmatter),
73        Box::new(assets::AssetNamesUnique),
74        Box::new(asset_refs::AssetRefsExist),
75        Box::new(machine_paths::NoMachinePaths),
76        Box::new(counts::CountsMatch),
77        Box::new(hidden::HiddenChars),
78        Box::new(translations::TranslationsCurrent),
79        Box::new(lifecycle::ExceptionsReviewed),
80        Box::new(pins::PinsHold),
81        Box::new(translations::TranslationsPlaced),
82    ]
83}