Skip to main content

Crate refquiem

Crate refquiem 

Source
Expand description

§cargo-refquiem

CI codecov crates.io docs.rs License: MIT

A cargo requiem for the refs your Rust code left behind.

cargo refquiem finds the Rust items, dependencies, features, binaries and examples your git history removed, and reports the comments, doc comments, string literals and Markdown that still name them, with what each most likely became. The wiki explains matching, configuration, reports and the Action in depth.

A refquiem pull request review flags a stale Rust function name and suggests its replacement

§Usage

cargo install refquiem --locked
cargo refquiem                                 # every commit, against the working tree
cargo refquiem --base origin/main --head HEAD  # what a branch removed
cargo refquiem --json                          # the report as JSON
cargo refquiem --markdown > report.md         # findings with suggested actions, linked when the repository is on GitHub
cargo refquiem vocabularies                    # bundled vocabularies and their sources
cargo refquiem vocabularies --effective        # resolved workspace vocabulary selection

The exit status is 0 when nothing is stale, 1 with findings and 2 on errors. A .refquiem.toml at the workspace root selects optional vocabularies through builtins, such as english, sql@2023, android@36 or posix@2017, which cargo refquiem vocabularies lists, and project-owned files, and configures excludes and allowed names. A refquiem: allow(Name) comment silences one mention, and cargo refquiem --help lists every option.

§GitHub Action

The action guide reviews each pull request with a suggested fix for every stale mention, pull requests from forks included.

§Library

Depend on refquiem with default-features = false to drop the CLI, then call refquiem::run as the Library page shows. refquiem::vocabulary exposes the catalog and effective selection. Coding agents get the same guidance from the refquiem skill.

npx skills add LucaCappelletti94/cargo-refquiem

Modules§

vocabulary
The vocabularies refquiem can use, and which the selected configuration uses.
web
The GitHub web root of a scanned repository and the URLs it gives a commit, a path and a line.

Structs§

Context
Where a mention sits.
Group
A removed name and its remaining mentions.
Mention
One mention of a removed name.
Options
What to scan.
Position
A line of a file.
Report
Every removed name still mentioned, by path.
Skipped
A removed dependency whose items could not be checked.
Suggestion
The name a removed name most likely became.
UnusedMarker
A name in a suppression marker that suppressed no mention.
Uppercase
A spelling a selected exact-case vocabulary holds.

Enums§

Change
How a suggested name relates to the removed one.
Error
A failed scan.
ItemKind
The kind of a removed name.
Kind
The Markdown structure a mention sits in.
Range
Which commits are scanned and what they are compared against.
RemovedIn
The change that removed a name.
Source
The text a mention sits in.

Functions§

run
Scans the repository and workspace containing options.root.