Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ hex = { version = "*" }
toml_edit = { version = "*" }

syn = { version = "2", features = ["full", "extra-traits"] }
verus_syn = { git = "https://github.com/verus-lang/verus.git", features = ["full", "parsing", "printing", "clone-impls"] }
quote = { version = "*" }
proc-macro2 = { version = "*" }

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ pre-commit = "run --manifest-path dv/Cargo.toml --bin pre_commit --"
cargo dv verify --targets <target1> <target2> ...
```

To check exec API alignment against an anchor repository, use the integrated
alignment checker:

```bash
cargo dv alignment-check -i [path/to/config/toml]
```

Optionally, if you want to use the pre-commit hook, you can add the rusty-hook to your project:

```bash
Expand All @@ -37,4 +44,3 @@ pre-commit = "cargo pre-commit"
[logging]
verbose = true
```

29 changes: 29 additions & 0 deletions src/alignment_checker.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#[path = "alignment_checker_check.rs"]
mod check;
#[path = "alignment_checker_cli.rs"]
pub mod cli;
#[path = "alignment_checker_index.rs"]
mod index;

pub use check::CheckSummary;

pub fn check_consistency(args: &cli::Args) -> anyhow::Result<CheckSummary> {
let loaded_config = cli::LoadedConfig::from_path(&args.input)?;
loaded_config.check_consistency()
}

pub fn plural(count: usize) -> &'static str {
if count == 1 {
""
} else {
"s"
}
}

pub fn entry_plural(count: usize) -> &'static str {
if count == 1 {
"y"
} else {
"ies"
}
}
Loading
Loading