diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 227aeba5e..98093a7b5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install nightly -c rust-docs + rustup toolchain install nightly -c rust-docs,rustfmt rustup default nightly - name: Install mdbook run: | @@ -44,7 +44,11 @@ jobs: - name: Run tests run: mdbook test - name: Style checks - run: (cd style-check && cargo run -- ../src) + working-directory: style-check + run: cargo run -- ../src + - name: Style fmt + working-directory: style-check + run: cargo fmt --check - name: Check for broken links run: | curl -sSLo linkcheck.sh \ diff --git a/style-check/src/main.rs b/style-check/src/main.rs index 4a9ff9a69..b046cdf70 100644 --- a/style-check/src/main.rs +++ b/style-check/src/main.rs @@ -71,7 +71,11 @@ fn check_directory(dir: &Path, bad: &mut bool) -> Result<(), Box> { style_error!(bad, path, "em-dash not allowed, use three dashes like ---"); } if contents.contains('\u{a0}') { - style_error!(bad, path, "don't use 0xa0 no-break-space, use   instead"); + style_error!( + bad, + path, + "don't use 0xa0 no-break-space, use   instead" + ); } for line in contents.lines() { if line.ends_with(' ') {