mirror of https://github.com/astral-sh/ruff
Rename timestamped_println
This commit is contained in:
parent
ebdfea95a4
commit
4aae3bfacb
|
|
@ -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)?;
|
||||||
|
|
|
||||||
|
|
@ -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!(
|
||||||
"[{}] {}",
|
"[{}] {}",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue