Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Visually align outputs. #314

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 14 additions & 14 deletions forc/src/ops/forc_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub fn build(command: BuildCommand) -> Result<Vec<u8>, String> {
file.write_all(main.as_slice()).map_err(|e| e.to_string())?;
}

println!("Bytecode size is {} bytes.", main.len());
println!(" Bytecode size is {} bytes.", main.len());

Ok(main)
}
Expand Down Expand Up @@ -253,10 +253,10 @@ fn compile_library<'source, 'manifest>(
}

if warnings.is_empty() {
let _ = println_green_err(&format!("Compiled library {:?}.", proj_name));
let _ = println_green_err(&format!(" Compiled library {:?}.", proj_name));
} else {
let _ = println_yellow_err(&format!(
"Compiled library {:?} with {} {}.",
" Compiled library {:?} with {} {}.",
proj_name,
warnings.len(),
if warnings.len() > 1 {
Expand All @@ -278,7 +278,7 @@ fn compile_library<'source, 'manifest>(
}

println_red_err(&format!(
"Aborting due to {} {}.",
" Aborting due to {} {}.",
e_len,
if e_len > 1 { "errors" } else { "error" }
))
Expand Down Expand Up @@ -310,10 +310,10 @@ fn compile<'source, 'manifest>(
}

if warnings.is_empty() {
let _ = println_green_err(&format!("Compiled script {:?}.", proj_name));
let _ = println_green_err(&format!(" Compiled script {:?}.", proj_name));
} else {
let _ = println_yellow_err(&format!(
"Compiled script {:?} with {} {}.",
" Compiled script {:?} with {} {}.",
proj_name,
warnings.len(),
if warnings.len() > 1 {
Expand All @@ -331,10 +331,10 @@ fn compile<'source, 'manifest>(
}

if warnings.is_empty() {
let _ = println_green_err(&format!("Compiled library {:?}.", proj_name));
let _ = println_green_err(&format!(" Compiled library {:?}.", proj_name));
} else {
let _ = println_yellow_err(&format!(
"Compiled library {:?} with {} {}.",
" Compiled library {:?} with {} {}.",
proj_name,
warnings.len(),
if warnings.len() > 1 {
Expand All @@ -356,7 +356,7 @@ fn compile<'source, 'manifest>(
}

println_red_err(&format!(
"Aborting due to {} {}.",
" Aborting due to {} {}.",
e_len,
if e_len > 1 { "errors" } else { "error" }
))
Expand Down Expand Up @@ -448,10 +448,10 @@ fn compile_to_asm<'source, 'manifest>(
warnings.iter().for_each(|warning| format_warning(warning));

if warnings.is_empty() {
let _ = println_green_err(&format!("Compiled script {:?}.", proj_name));
let _ = println_green_err(&format!(" Compiled script {:?}.", proj_name));
} else {
let _ = println_yellow_err(&format!(
"Compiled script {:?} with {} {}.",
" Compiled script {:?} with {} {}.",
proj_name,
warnings.len(),
if warnings.len() > 1 {
Expand All @@ -467,10 +467,10 @@ fn compile_to_asm<'source, 'manifest>(
warnings.iter().for_each(|warning| format_warning(warning));

if warnings.is_empty() {
let _ = println_green_err(&format!("Compiled library {:?}.", proj_name));
let _ = println_green_err(&format!(" Compiled library {:?}.", proj_name));
} else {
let _ = println_yellow_err(&format!(
"Compiled library {:?} with {} {}.",
" Compiled library {:?} with {} {}.",
proj_name,
warnings.len(),
if warnings.len() > 1 {
Expand All @@ -490,7 +490,7 @@ fn compile_to_asm<'source, 'manifest>(
errors.into_iter().for_each(|error| format_err(error));

println_red_err(&format!(
"Aborting due to {} {}.",
" Aborting due to {} {}.",
e_len,
if e_len > 1 { "errors" } else { "error" }
))
Expand Down
4 changes: 2 additions & 2 deletions test/src/e2e_vm_tests/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rand::{Rng, SeedableRng};
pub(crate) fn deploy_contract(file_name: &str) {
// build the contract
// deploy it
println!("Deploying {}", file_name);
println!(" Deploying {}", file_name);
let manifest_dir = env!("CARGO_MANIFEST_DIR");

tokio::runtime::Runtime::new()
Expand Down Expand Up @@ -137,7 +137,7 @@ pub(crate) fn does_not_compile(file_name: &str) {
/// Returns `true` if a file compiled without any errors or warnings,
/// and `false` if it did not.
pub(crate) fn compile_to_bytes(file_name: &str) -> Result<Vec<u8>, String> {
println!("Compiling {}", file_name);
println!(" Compiling {}", file_name);
let manifest_dir = env!("CARGO_MANIFEST_DIR");
forc_build::build(BuildCommand {
path: Some(format!(
Expand Down