Skip to main content

specfold_core/config/
defaults.rs

1//! Default values for spec.toml, kept apart so the schema reads as data.
2
3pub const CONFIG_FILE: &str = "spec.toml";
4
5/// Manifests that make a directory a package owner in any common ecosystem.
6pub const MANIFESTS: &[&str] = &[
7    "package.json",
8    "Cargo.toml",
9    "go.mod",
10    "pyproject.toml",
11    "setup.py",
12    "pom.xml",
13    "build.gradle",
14    "build.gradle.kts",
15    "composer.json",
16    "Gemfile",
17    "mix.exs",
18    "Package.swift",
19    "pubspec.yaml",
20    "*.csproj",
21    "*.fsproj",
22    "deno.json",
23];
24
25pub fn schema() -> u32 {
26    1
27}
28
29pub fn spec_dir() -> String {
30    ".spec".into()
31}
32
33pub fn root_owner() -> String {
34    "root".into()
35}
36
37pub fn local_dir() -> String {
38    ".spec.local".into()
39}
40
41pub fn cite_check() -> String {
42    "cite-check".into()
43}
44
45pub fn inline_max_bytes() -> u64 {
46    262_144
47}
48
49pub fn guard_range() -> String {
50    "staged".into()
51}
52
53pub fn guard_level() -> String {
54    "error".into()
55}
56
57pub fn yes() -> bool {
58    true
59}
60
61pub fn plugin_timeout_ms() -> u64 {
62    30_000
63}
64
65pub fn verify_timeout_ms() -> u64 {
66    60_000
67}
68
69pub fn stale_days() -> i64 {
70    30
71}
72
73pub fn stalled_days() -> i64 {
74    14
75}
76
77pub fn draft_days() -> i64 {
78    30
79}
80
81pub fn open_item_patterns() -> Vec<String> {
82    vec!["TODO".into(), "FIXME".into(), "TBD".into()]
83}
84
85pub fn history_patterns() -> Vec<String> {
86    vec![r"(?i)\bmoved (to|from)\b".into(), r"(?i)\bformerly\b".into(), r"(?i)\brenamed (to|from)\b".into()]
87}