Rename timestamped_println

This commit is contained in:
Charles Marsh 2022-08-13 11:39:45 -04:00
parent ebdfea95a4
commit 4aae3bfacb
2 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ use ::rust_python_linter::fs::collect_python_files;
use ::rust_python_linter::linter::check_path; use ::rust_python_linter::linter::check_path;
use ::rust_python_linter::logging::set_up_logging; use ::rust_python_linter::logging::set_up_logging;
use ::rust_python_linter::message::Message; use ::rust_python_linter::message::Message;
use ::rust_python_linter::timestamped_println; use ::rust_python_linter::tell_user;
use anyhow::Result; use anyhow::Result;
use clap::{Parser, ValueHint}; use clap::{Parser, ValueHint};
use colored::Colorize; use colored::Colorize;
@ -67,7 +67,7 @@ fn report_once(messages: &[Message]) -> Result<()> {
} }
fn report_continuously(messages: &[Message]) -> Result<()> { fn report_continuously(messages: &[Message]) -> Result<()> {
timestamped_println!( tell_user!(
"Found {} error(s). Watching for file changes.", "Found {} error(s). Watching for file changes.",
messages.len(), messages.len(),
); );
@ -90,7 +90,7 @@ fn main() -> Result<()> {
if cli.watch { if cli.watch {
// Perform an initial run instantly. // Perform an initial run instantly.
clearscreen::clear()?; clearscreen::clear()?;
timestamped_println!("Starting linter in watch mode...\n"); tell_user!("Starting linter in watch mode...\n");
let messages = run_once(&cli.files, !cli.no_cache)?; let messages = run_once(&cli.files, !cli.no_cache)?;
report_continuously(&messages)?; report_continuously(&messages)?;
@ -107,7 +107,7 @@ fn main() -> Result<()> {
Ok(_) => { Ok(_) => {
// Re-run on all change events. // Re-run on all change events.
clearscreen::clear()?; clearscreen::clear()?;
timestamped_println!("File change detected...\n"); tell_user!("File change detected...\n");
let messages = run_once(&cli.files, !cli.no_cache)?; let messages = run_once(&cli.files, !cli.no_cache)?;
report_continuously(&messages)?; report_continuously(&messages)?;

View File

@ -2,7 +2,7 @@ use anyhow::Result;
use fern; use fern;
#[macro_export] #[macro_export]
macro_rules! timestamped_println { macro_rules! tell_user {
($($arg:tt)*) => { ($($arg:tt)*) => {
println!( println!(
"[{}] {}", "[{}] {}",