diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 63cf589de7..45de5cead7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -56,5 +56,12 @@ jobs: - name: Install Rust uses: mkroening/rust-toolchain-toml@main + - name: Install Just + run: | + wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz + tar -vxf just-1.14.0-x86_64-unknown-linux-musl.tar.gz just + sudo cp just /usr/bin/just + - name: Check rustfmt - run: cargo fmt --check + run: | + just ${{ matrix.just_variants }} fmt_check diff --git a/crates/testing/tests/tests_1/quorum_vote_task.rs b/crates/testing/tests/tests_1/quorum_vote_task.rs index eea01a8b6b..b8b4680bcd 100644 --- a/crates/testing/tests/tests_1/quorum_vote_task.rs +++ b/crates/testing/tests/tests_1/quorum_vote_task.rs @@ -276,4 +276,3 @@ async fn test_quorum_vote_task_incorrect_dependency() { }; run_test![inputs, script].await; } - diff --git a/crates/testing/tests/tests_2/catchup.rs b/crates/testing/tests/tests_2/catchup.rs index 4a3bd8c8f8..433a35a666 100644 --- a/crates/testing/tests/tests_2/catchup.rs +++ b/crates/testing/tests/tests_2/catchup.rs @@ -312,9 +312,10 @@ async fn test_all_restart() { let mut catchup_nodes = vec![]; for i in 1..20 { catchup_nodes.push(ChangeNode { - idx: i, - updown: UpDown::Restart, - })}; + idx: i, + updown: UpDown::Restart, + }) + } metadata.timing_data = timing_data; metadata.start_nodes = 20; diff --git a/justfile b/justfile index 80c7c1298f..4128842064 100644 --- a/justfile +++ b/justfile @@ -186,29 +186,31 @@ clippy: echo clippy cargo clippy --workspace --examples --bins --tests -- -D warnings -lint: - echo linting - cargo fmt --check - cargo clippy --workspace --examples --bins --tests -- -D warnings +clippy_dependency_tasks: + echo clippy release + cargo clippy --workspace --examples --bins --tests --features "dependency-tasks" -- -D warnings -lint_release: - echo linting - cargo fmt --check +clippy_release: + echo clippy release cargo clippy --package hotshot --no-default-features --features="docs, doc-images" -- -D warnings fmt: echo Running cargo fmt - cargo fmt + cargo fmt -- crates/**/*.rs + cargo fmt -- crates/**/tests/**/**.rs -fmt_lint: - echo Formatting and linting - cargo fmt - cargo clippy --workspace --examples --bins --tests -- -D warnings +fmt_check: + echo Running cargo fmt --check + cargo fmt --check -- crates/**/*.rs + cargo fmt --check -- crates/**/tests/**/**.rs -fmt_lint_dependency_tasks: - echo Formatting and linting - cargo fmt - cargo clippy --workspace --examples --bins --tests --features "dependency-tasks" -- -D warnings +lint: clippy fmt_check + +lint_release: clippy_release fmt_check + +fmt_clippy: fmt clippy + +fmt_clippy_dependency_tasks: fmt clippy_dependency_tasks careful: echo Careful-ing with tokio executor