diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..4bbac33c9 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +fmt: + cd code && cargo +nightly fmt + +lint: + cd code && cargo fmt --all --check + +lint-fix: + make fmt + cd code && cargo clippy --fix --allow-dirty --workspace -- -D warnings + +test: + cd code && cargo test \ No newline at end of file diff --git a/code/crates/starknet/p2p-proto/build.rs b/code/crates/starknet/p2p-proto/build.rs index 3d026ee65..0e1dfc8b5 100644 --- a/code/crates/starknet/p2p-proto/build.rs +++ b/code/crates/starknet/p2p-proto/build.rs @@ -16,6 +16,7 @@ fn main() -> Result<(), Box> { config.bytes(["."]); config.enable_type_names(); config.default_package_filename("p2p"); + config.disable_comments(["."]); // This will disable doc comments generation config.compile_protos(protos, &["./proto"])?; Ok(()) diff --git a/code/crates/test/cli/src/logging.rs b/code/crates/test/cli/src/logging.rs index 497273add..a37bfd926 100644 --- a/code/crates/test/cli/src/logging.rs +++ b/code/crates/test/cli/src/logging.rs @@ -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()