diff options
| author | aur-build <aur-build@localhost> | 2026-11-19 17:09:59 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-19 17:09:59 +0000 |
| commit | e757979f1a2afdbe7146066345bb9acd19d3b151 (patch) | |
| tree | 30d5f5fbccd25ea7bf01c5202684af463b74e7d3 /tests/schema_ownership.rs | |
| parent | 94c318f13264bb3c00a9f3057ba2e1aafb57c9e4 (diff) | |
| download | aur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.tar.gz aur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.zip | |
comments: say why, not what
Every module-level `//!` header is gone, and the comments that remained
either re-explained the line below them or had grown into paragraphs.
Density went from one comment line per 6.7 lines of code to one per 10.
827 insertions against 2194 deletions across 86 files.
What survived: the invariants (I1-I12), the design cross-references into
DESIGN.md, and the notes recording a bug that was found and fixed โ those
are the comments that carry weight, because they answer a question the
code cannot answer about itself. What did not: restating a function
signature in prose, and narration of the statement underneath.
Diffstat (limited to 'tests/schema_ownership.rs')
| -rw-r--r-- | tests/schema_ownership.rs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/tests/schema_ownership.rs b/tests/schema_ownership.rs index dac93d6..07345dd 100644 --- a/tests/schema_ownership.rs +++ b/tests/schema_ownership.rs @@ -1,15 +1,3 @@ -//! The schema has one owner (ยง6 M-1). -//! -//! `db/` is a boundary, not a directory, only if SQL cannot land anywhere else. -//! Part of that is a compile-time fact: `Writer::call`, `tx` and `send` are -//! `pub(crate)`, and the raw door the test harness uses exists only under the -//! `test-support` feature. What the compiler cannot express is the other half โ -//! that no module *inside* this crate writes a statement of its own. This does. -//! -//! The rule it enforces: a SQL statement, or a rusqlite statement call, appears -//! in `src/db/` and nowhere else. A module that needs the database asks `db/` -//! for a typed query; if the query does not exist, that is the change to make. - use std::path::{Path, PathBuf}; /// String literals that begin a statement. Matched on the quote so a prose @@ -73,11 +61,9 @@ fn no_sql_statements_outside_the_db_module() { } /// m-18: the version a human reads is `pkgver::full_version`'s to produce โ -/// `epoch:pkgver-pkgrel`, with the epoch omitted when it is `0` or empty. That -/// rule used to exist twice, once in Rust and once as a `CASE WHEN epoch='0'` -/// inside `approved_but_unbuilt`, where a change to one would silently make the -/// Attention page disagree with every other page about what a version looks -/// like. SQL selects the parts; Rust formats them. +/// `epoch:pkgver-pkgrel`, with the epoch omitted when it is `0` or empty. That rule +/// used to exist twice, once in Rust and once in SQL. SQL selects the parts; Rust +/// formats them. #[test] fn only_rust_formats_a_version() { let root = Path::new(env!("CARGO_MANIFEST_DIR")); |
