mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-09 13:18:52 +00:00
Rename Red Knot (#17820)
This commit is contained in:
parent
e6a798b962
commit
b51c4f82ea
1564 changed files with 1598 additions and 1578 deletions
|
@ -134,20 +134,20 @@ impl Diagnostic {
|
|||
/// NOTE: At present, this routine will return the first primary
|
||||
/// annotation's message as the primary message when the main diagnostic
|
||||
/// message is empty. This is meant to facilitate an incremental migration
|
||||
/// in Red Knot over to the new diagnostic data model. (The old data model
|
||||
/// in ty over to the new diagnostic data model. (The old data model
|
||||
/// didn't distinguish between messages on the entire diagnostic and
|
||||
/// messages attached to a particular span.)
|
||||
pub fn primary_message(&self) -> &str {
|
||||
if !self.inner.message.as_str().is_empty() {
|
||||
return self.inner.message.as_str();
|
||||
}
|
||||
// FIXME: As a special case, while we're migrating Red Knot
|
||||
// FIXME: As a special case, while we're migrating ty
|
||||
// to the new diagnostic data model, we'll look for a primary
|
||||
// message from the primary annotation. This is because most
|
||||
// Red Knot diagnostics are created with an empty diagnostic
|
||||
// ty diagnostics are created with an empty diagnostic
|
||||
// message and instead attach the message to the annotation.
|
||||
// Fixing this will require touching basically every diagnostic
|
||||
// in Red Knot, so we do it this way for now to match the old
|
||||
// in ty, so we do it this way for now to match the old
|
||||
// semantics. ---AG
|
||||
self.primary_annotation()
|
||||
.and_then(|ann| ann.get_message())
|
||||
|
@ -165,7 +165,7 @@ impl Diagnostic {
|
|||
///
|
||||
/// The reason why we don't just always return both the main diagnostic
|
||||
/// message and the primary annotation message is because this was written
|
||||
/// in the midst of an incremental migration of Red Knot over to the new
|
||||
/// in the midst of an incremental migration of ty over to the new
|
||||
/// diagnostic data model. At time of writing, diagnostics were still
|
||||
/// constructed in the old model where the main diagnostic message and the
|
||||
/// primary annotation message were not distinguished from each other. So
|
||||
|
|
|
@ -624,7 +624,7 @@ impl<'r> RenderableAnnotation<'r> {
|
|||
/// For example, at time of writing (2025-03-07), the plan is (roughly) for
|
||||
/// Ruff to grow its own interner of file paths so that a `Span` can store an
|
||||
/// interned ID instead of a (roughly) `Arc<Path>`. This interner is planned
|
||||
/// to be entirely separate from the Salsa interner used by Red Knot, and so,
|
||||
/// to be entirely separate from the Salsa interner used by ty, and so,
|
||||
/// callers will need to pass in a different "resolver" for turning `Span`s
|
||||
/// into actual file paths/contents. The infrastructure for this isn't fully in
|
||||
/// place, but this type serves to demarcate the intended abstraction boundary.
|
||||
|
|
|
@ -107,7 +107,7 @@ fn query_name<Q>(_query: &Q) -> &'static str {
|
|||
.unwrap_or(full_qualified_query_name)
|
||||
}
|
||||
|
||||
/// Sets up logging for the current thread. It captures all `red_knot` and `ruff` events.
|
||||
/// Sets up logging for the current thread. It captures all `ty` and `ruff` events.
|
||||
///
|
||||
/// Useful for capturing the tracing output in a failing test.
|
||||
///
|
||||
|
@ -128,7 +128,7 @@ pub fn setup_logging() -> LoggingGuard {
|
|||
/// # Examples
|
||||
/// ```
|
||||
/// use ruff_db::testing::setup_logging_with_filter;
|
||||
/// let _logging = setup_logging_with_filter("red_knot_module_resolver::resolver");
|
||||
/// let _logging = setup_logging_with_filter("ty_module_resolver::resolver");
|
||||
/// ```
|
||||
///
|
||||
/// # Filter
|
||||
|
@ -148,11 +148,7 @@ impl LoggingBuilder {
|
|||
pub fn new() -> Self {
|
||||
Self {
|
||||
filter: EnvFilter::default()
|
||||
.add_directive(
|
||||
"red_knot=trace"
|
||||
.parse()
|
||||
.expect("Hardcoded directive to be valid"),
|
||||
)
|
||||
.add_directive("ty=trace".parse().expect("Hardcoded directive to be valid"))
|
||||
.add_directive(
|
||||
"ruff=trace"
|
||||
.parse()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue