Skip to content

Commit

Permalink
Run cargo fmt in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Nov 5, 2023
1 parent 86a85bc commit 0dc253e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- name: Install tools
run: |
rustup install nightly
rustup component add rustfmt --toolchain nightly
cargo install cargo-license || true
cargo install cargo-sort || true
Expand Down
8 changes: 8 additions & 0 deletions cast_checks/tests/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ fn clippy() {
.success();
}

#[test]
fn format() {
Command::new("rustup")
.args(["run", "nightly", "cargo", "fmt", "--check"])
.assert()
.success();
}

#[test]
fn license() {
let re = Regex::new(r"^[^:]*\b(Apache-2.0|BSD-3-Clause|MIT)\b").unwrap();
Expand Down
4 changes: 2 additions & 2 deletions macro/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fn main() {
if enabled("CAST_CHECKS_LOG") && cfg!(not(procmacro2_semver_exempt)) {
println!(
"cargo:warning=`CAST_CHECKS_LOG` is enabled, but this option requires \
`--cfg procmacro2_semver_exempt` to be passed to rustc"
"cargo:warning=`CAST_CHECKS_LOG` is enabled, but this option requires `--cfg \
procmacro2_semver_exempt` to be passed to rustc"
);
}

Expand Down
2 changes: 1 addition & 1 deletion macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use syn::{
/// #[cast_checks::enable]
/// fn as_u16(x: u64) -> u16 {
/// x as u16
///}
/// }
/// ```
///
/// For additional details, see the [repository documentation].
Expand Down
3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
comment_width = 100
format_strings = true
wrap_comments = true

0 comments on commit 0dc253e

Please sign in to comment.