Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert format_util_readmes to Rust test #1077

Merged
merged 1 commit into from
Feb 23, 2024
Merged
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
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.