Skip to content

Commit

Permalink
Convert format_util_readmes to Rust test
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Feb 23, 2024
1 parent 535162e commit 879ba26
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,13 @@ jobs:
rm -f "$HOME"/.cargo/bin/rustfmt
rustup install nightly
rustup component add rustfmt --toolchain nightly
cargo install cargo-rdme || true
- name: Format
run: ./scripts/format.sh && git diff --exit-code

- name: Format example READMEs
run: ./scripts/update_example_READMEs.sh && git diff --exit-code

- name: Format util READMEs
run: ./scripts/update_util_READMEs.sh && git diff --exit-code

- name: Lint
run: ./scripts/lint.sh

Expand Down Expand Up @@ -145,6 +141,7 @@ jobs:
cargo install cargo-hack || true
cargo install cargo-license || true
cargo install cargo-msrv || true
cargo install cargo-rdme || true
cargo install cargo-sort || true
cargo install cargo-supply-chain || true
cargo install cargo-udeps --locked || true
Expand Down
17 changes: 16 additions & 1 deletion cargo-dylint/tests/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use similar_asserts::SimpleDiff;
use std::{
env::{set_current_dir, set_var},
ffi::OsStr,
fs::{read_to_string, write},
fs::{read_dir, read_to_string, write},
io::{stderr, Write},
path::{Component, Path, PathBuf},
str::FromStr,
Expand Down Expand Up @@ -122,6 +122,21 @@ fn cargo_dylint_and_dylint_readmes_are_equal() {
compare_lines(&cargo_dylint_readme, &dylint_readme);
}

#[test]
fn format_util_readmes() {
preserves_cleanliness("format_util_readmes", false, || {
for entry in read_dir("utils").unwrap() {
let entry = entry.unwrap();
let path = entry.path();
Command::new("cargo")
.arg("rdme")
.current_dir(path)
.assert()
.success();
}
});
}

#[test]
fn hack_feature_powerset_udeps() {
Command::new("rustup")
Expand Down
17 changes: 0 additions & 17 deletions scripts/update_util_READMEs.sh

This file was deleted.

0 comments on commit 879ba26

Please sign in to comment.