1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
//! Shared RustUse repository layout standards.
//!
//! This module defines common paths, files, and directory names used across
//! RustUse repositories. It should not inspect the filesystem, render reports,
//! mutate files, or run commands.
/// Simple standard path entry used by scan/report code.
///
/// Tuple shape:
/// - `.0` = path
/// - `.1` = human-readable description
pub type StandardPath = ;
// -----------------------------------------------------------------------------
// Common directory names
// -----------------------------------------------------------------------------
pub const CARGO_CONFIG_DIR: &str = ".cargo";
pub const GITHUB_DIR: &str = ".github";
pub const GITLAB_DIR: &str = ".gitlab";
pub const DEVCONTAINER_DIR: &str = ".devcontainer";
pub const CRATES_DIR: &str = "crates";
// -----------------------------------------------------------------------------
// Common root file names
// -----------------------------------------------------------------------------
pub const CARGO_MANIFEST: &str = "Cargo.toml";
pub const CARGO_LOCK: &str = "Cargo.lock";
pub const RUST_TOOLCHAIN: &str = "rust-toolchain.toml";
pub const README: &str = "README.md";
pub const CHANGELOG: &str = "CHANGELOG.md";
pub const CONTRIBUTING: &str = "CONTRIBUTING.md";
pub const GOVERNANCE: &str = "GOVERNANCE.md";
pub const MAINTAINERS: &str = "MAINTAINERS.md";
pub const RELEASE: &str = "RELEASE.md";
pub const RELEASING: &str = "RELEASING.md";
pub const LICENSE: &str = "LICENSE";
pub const LICENSE_APACHE: &str = "LICENSE-APACHE";
pub const LICENSE_MIT: &str = "LICENSE-MIT";
pub const CLIPPY_CONFIG: &str = ".clippy.toml";
pub const EDITORCONFIG: &str = ".editorconfig";
pub const GITATTRIBUTES: &str = ".gitattributes";
pub const GITIGNORE: &str = ".gitignore";
pub const GITLEAKS_CONFIG: &str = ".gitleaks.toml";
pub const MARKDOWNLINTIGNORE: &str = ".markdownlintignore";
pub const RUSTFMT_CONFIG: &str = ".rustfmt.toml";
pub const TAPLO_CONFIG: &str = ".taplo.toml";
pub const TRIVYIGNORE: &str = ".trivyignore";
pub const DENY_CONFIG: &str = "deny.toml";
pub const RELEASE_PLZ_CONFIG: &str = "release-plz.toml";
pub const GITLAB_CI_CONFIG: &str = ".gitlab-ci.yml";
pub const MAKEFILE: &str = "Makefile";
// -----------------------------------------------------------------------------
// Common GitHub workflow paths
// -----------------------------------------------------------------------------
// pub const GITHUB_WORKFLOWS: &str = ".github/workflows";
/* pub const GITHUB_CI_WORKFLOW: &str = ".github/workflows/ci.yml";
pub const GITHUB_CODEQL_WORKFLOW: &str = ".github/workflows/codeql.yml";
pub const GITHUB_RELEASE_WORKFLOW: &str = ".github/workflows/release.yml";
pub const GITHUB_TRIVY_WORKFLOW: &str = ".github/workflows/trivy.yml"; */
// -----------------------------------------------------------------------------
// Common standard file groups
// -----------------------------------------------------------------------------
/* /// Standard formatting, editor, and repository hygiene files.
pub const STANDARD_TOOLING_FILES: &[StandardPath] = &[
(CLIPPY_CONFIG, "Clippy configuration"),
(EDITORCONFIG, "EditorConfig"),
(GITATTRIBUTES, "Git attributes"),
(GITIGNORE, "Git ignore rules"),
(MARKDOWNLINTIGNORE, "Markdownlint ignore rules"),
(RUSTFMT_CONFIG, "Rustfmt configuration"),
(TAPLO_CONFIG, "Taplo configuration"),
];
/// Standard security and dependency policy files.
pub const STANDARD_SECURITY_FILES: &[StandardPath] = &[
(DENY_CONFIG, "cargo-deny configuration"),
(GITLEAKS_CONFIG, "Gitleaks configuration"),
(TRIVYIGNORE, "Trivy ignore rules"),
];
/// Standard license files.
pub const STANDARD_LICENSE_FILES: &[StandardPath] = &[
(LICENSE, "Repository license summary"),
(LICENSE_APACHE, "Apache license"),
(LICENSE_MIT, "MIT license"),
];
/// Standard documentation and governance files.
pub const STANDARD_DOCUMENTATION_FILES: &[StandardPath] = &[
(README, "README"),
(CHANGELOG, "Changelog"),
(CONTRIBUTING, "Contribution guide"),
(GOVERNANCE, "Governance"),
(MAINTAINERS, "Maintainers"),
(RELEASE, "Release notes"),
(RELEASING, "Release process"),
];
/// Standard Rust/Cargo root files.
pub const STANDARD_RUST_FILES: &[StandardPath] = &[
(CARGO_MANIFEST, "Cargo manifest"),
(CARGO_LOCK, "Cargo lockfile"),
(RUST_TOOLCHAIN, "Rust toolchain pin"),
];
/// Standard release automation files.
pub const STANDARD_RELEASE_FILES: &[StandardPath] =
&[(RELEASE_PLZ_CONFIG, "release-plz configuration")];
/// Optional local/developer environment directories.
pub const OPTIONAL_DEVELOPMENT_DIRECTORIES: &[StandardPath] = &[
(DEVCONTAINER_DIR, "Dev container"),
(GITLAB_DIR, "GitLab configuration"),
];
/// Directories that usually should not be treated as committed RustUse standards.
pub const LOCAL_OR_GENERATED_DIRECTORIES: &[StandardPath] = &[
(TARGET_DIR, "Cargo build output"),
(VSCODE_DIR, "Local editor state"),
];
/// Generated files that should usually be ignored unless explicitly requested.
pub const GENERATED_REPORT_FILES: &[StandardPath] = &[
("rustuse-report.md", "Generated RustUse report"),
("sbom.cyclonedx.json", "Generated SBOM"),
("sbom.cyclonedx.xml", "Generated SBOM"),
];
/// Standard GitHub workflow files.
pub const STANDARD_GITHUB_WORKFLOW_FILES: &[StandardPath] = &[
(GITHUB_CI_WORKFLOW, "GitHub CI workflow"),
(GITHUB_CODEQL_WORKFLOW, "GitHub CodeQL workflow"),
(GITHUB_RELEASE_WORKFLOW, "GitHub release workflow"),
(GITHUB_TRIVY_WORKFLOW, "GitHub Trivy workflow"),
];
/// Core directories common to RustUse Rust repositories.
pub const STANDARD_RUST_REPOSITORY_DIRECTORIES: &[StandardPath] = &[
(SRC_DIR, "Rust source directory"),
(TESTS_DIR, "Integration tests"),
];
/// Core directories common to RustUse facade repositories.
pub const STANDARD_FACADE_DIRECTORIES: &[StandardPath] = &[
(CARGO_CONFIG_DIR, "Cargo configuration"),
(GITHUB_DIR, "GitHub configuration"),
(CRATES_DIR, "Crate workspace members"),
];
/// Optional source-adjacent directories.
pub const OPTIONAL_RUST_SOURCE_DIRECTORIES: &[StandardPath] =
&[(EXAMPLES_DIR, "Examples"), (DOCS_DIR, "Documentation")];
*/