Skip to content

Commit

Permalink
[red-knot] Remove mentions of Ruff from the CLI help (#12752)
Browse files Browse the repository at this point in the history
Co-authored-by: Micha Reiser <[email protected]>
  • Loading branch information
AlexWaygood and MichaReiser authored Aug 8, 2024
1 parent f1de08c commit d28c5af
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions crates/red_knot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod verbosity;
#[command(
author,
name = "red-knot",
about = "An experimental multifile analysis backend for Ruff"
about = "An extremely fast Python type checker."
)]
#[command(version)]
struct Args {
Expand Down Expand Up @@ -67,7 +67,12 @@ to resolve type information for the project's third-party dependencies.",
)]
extra_search_path: Vec<SystemPathBuf>,

#[arg(long, help = "Python version to assume when resolving types", default_value_t = TargetVersion::default(), value_name="VERSION")]
#[arg(
long,
help = "Python version to assume when resolving types",
default_value_t = TargetVersion::default(),
value_name="VERSION")
]
target_version: TargetVersion,

#[clap(flatten)]
Expand Down Expand Up @@ -97,7 +102,7 @@ pub fn main() -> ExitStatus {

// This communicates that this isn't a linter error but Red Knot itself hard-errored for
// some reason (e.g. failed to resolve the configuration)
writeln!(stderr, "{}", "ruff failed".red().bold()).ok();
writeln!(stderr, "{}", "Red Knot failed".red().bold()).ok();
// Currently we generally only see one error, but e.g. with io errors when resolving
// the configuration it is help to chain errors ("resolving configuration failed" ->
// "failed to read file: subdir/pyproject.toml")
Expand Down Expand Up @@ -132,7 +137,13 @@ fn run() -> anyhow::Result<ExitStatus> {
// The base path to which all CLI arguments are relative to.
let cli_base_path = {
let cwd = std::env::current_dir().context("Failed to get the current working directory")?;
SystemPathBuf::from_path_buf(cwd).map_err(|path| anyhow!("The current working directory '{}' contains non-unicode characters. Red Knot only supports unicode paths.", path.display()))?
SystemPathBuf::from_path_buf(cwd)
.map_err(|path| {
anyhow!(
"The current working directory '{}' contains non-unicode characters. Red Knot only supports unicode paths.",
path.display()
)
})?
};

let cwd = current_directory
Expand Down Expand Up @@ -308,7 +319,9 @@ impl MainLoop {
tracing::error!("{}", diagnostic);
}
} else {
tracing::debug!("Discarding check result for outdated revision: current: {revision}, result revision: {check_revision}");
tracing::debug!(
"Discarding check result for outdated revision: current: {revision}, result revision: {check_revision}"
);
}

if self.watcher.is_none() {
Expand Down

0 comments on commit d28c5af

Please sign in to comment.