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

feat: add Makefile to easy fix-lint and test in local #751

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
23 changes: 23 additions & 0 deletions code/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
install:
npm i @informalsystems/quint -g
cargo install --locked cargo-nextest

lint:
cargo fmt --all --check
cargo clippy --workspace --all-features --all-targets -- -D warnings

lint-fix:
cargo fmt --all
cargo clippy --fix --allow-dirty --allow-staged --workspace --all-features --all-targets -- -D warnings
hoank101 marked this conversation as resolved.
Show resolved Hide resolved

unit-tests:
cargo nextest run \
--workspace \
--all-features \
--no-fail-fast \
--failure-output final \
--exclude informalsystems-malachitebft-starknet-test \
--exclude informalsystems-malachitebft-discovery-test


test: unit-tests
9 changes: 5 additions & 4 deletions code/crates/test/cli/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ pub fn init(log_level: LogLevel, log_format: LogFormat) -> WorkerGuard {
guard
}

/// Check if both stdout and stderr are proper terminal (tty),
/// so that we know whether or not to enable colored output,
/// using ANSI escape codes. If either is not, eg. because
/// stdout is redirected to a file, we don't enable colored output.
/// Checks if output is going to a terminal.
///
/// Determines if both stdout and stderr are proper terminals (TTY).
/// This helps decide whether to enable colored output with ANSI escape codes.
/// Colors are disabled when output is redirected to a file.
pub fn enable_ansi() -> bool {
use std::io::IsTerminal;
std::io::stdout().is_terminal() && std::io::stderr().is_terminal()
Expand Down
Loading