diff options
| author | aur-build <aur-build@localhost> | 2026-11-21 11:06:01 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-21 11:06:01 +0000 |
| commit | 7f5d3dc2ae540b7d4faf5e8c854e638fe70b9fd3 (patch) | |
| tree | f5e71b0e80e430bc0ec0b3956968bbdc38af40b6 /tests | |
| parent | 7ccfb9a8f96b6f3000f36bdf76d95a4f6afd2826 (diff) | |
| download | aur-build-7f5d3dc2ae540b7d4faf5e8c854e638fe70b9fd3.tar.gz aur-build-7f5d3dc2ae540b7d4faf5e8c854e638fe70b9fd3.zip | |
tools: a re-export is not a call, and an alias is not a stranger
The auditor's `open_reviews_for` was invisible for one reason: the cross-module
mention index counted `pub use` lines as production use, so the item was
discarded before it could become a row. The tool's own docstring already said
"a re-export is not a call" — the rule was simply applied to the in-module loop
and never to the cross-module one. Two implementations of one idea, one of them
ignored.
Fixing that exposed the next layer, because once re-exports stop counting, the
calls that remain are mostly made through a name the declaring module did not
choose:
- `ap::approve(..)` from `use crate::review::{approve as ap, ..}`
- `sources::recipe_hash(..)` from `use crate::watch::sources;`
- `crate::db::model::BUILD_STEPS` — a path is not just its last token
- `candidates::mark_viewed(..)` — an item declared in `db`, re-exported by
`review`, and called through `review`
So the mention resolver now resolves import prefixes, walks the whole qualified
path, and follows re-export edges (collected from the entire `use` statement,
not just its first line — the names live on the continuation lines, which is how
`mark_viewed` hid too).
It also learned the opposite lesson. `Vec::new()`, `v.parse::<u64>()` and
`stop.load(..)` are not mentions of `db::new`, `pkgver::parse` or
`pipeline::load`. Treating every unresolvable receiver as ambiguous buried the
real rows, so a qualified mention must now name a crate module or an imported
prefix to count as anything, and a method name declared in exactly one module is
credited on a value receiver — `cfg.validate()` is `config::validate`, because
nothing else in the crate could mean it. With that, the ambiguous column is empty
instead of full of noise.
`use_block_lines`, `gated_declarations`, `line_context` and `use_prefixes` each
re-read their file on every call — 15,280 reads of the same dozen files, two and
a half minutes per run. Memoised: 20.7s, same output.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/architecture-budget.json | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/architecture-budget.json b/tests/architecture-budget.json index 4046776..2702372 100644 --- a/tests/architecture-budget.json +++ b/tests/architecture-budget.json @@ -94,9 +94,9 @@ "glob": 0, "largest": 368, "largest_file": "src/db/mod.rs", - "lines": 3953, + "lines": 3923, "priv": 12, - "pub": 198, + "pub": 196, "test": 11 }, "error": { @@ -310,10 +310,10 @@ } }, "test_surface": { - "already-gated": 17, + "already-gated": 16, "interface": 1, "narrowed": 19, - "total": 37 + "total": 36 }, "totals": { "dead": 84, @@ -322,9 +322,9 @@ "glob": 0, "largest": 701, "largest_file": "src/config.rs", - "lines": 15734, + "lines": 15704, "priv": 150, - "pub": 472, + "pub": 470, "test": 49 } } |
