Skip to content

Commit

Permalink
Add tests for hard and soft links (#12590)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Aug 2, 2024
1 parent 27edade commit 966563c
Show file tree
Hide file tree
Showing 6 changed files with 603 additions and 107 deletions.
4 changes: 2 additions & 2 deletions clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ doc-valid-idents = [
"SCREAMING_SNAKE_CASE",
"SQLAlchemy",
"StackOverflow",
"PyCharm",
]

ignore-interior-mutability = [
# Interned is read-only. The wrapped `Rc` never gets updated.
"ruff_formatter::format_element::Interned",

# The expression is read-only.
# The expression is read-only.
"ruff_python_ast::hashable::HashableExpr",
]
2 changes: 1 addition & 1 deletion crates/red_knot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ notify = { workspace = true }
rayon = { workspace = true }
rustc-hash = { workspace = true }
salsa = { workspace = true }
filetime = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-tree = { workspace = true }

[dev-dependencies]
filetime = { workspace = true }
tempfile = { workspace = true }


Expand Down
8 changes: 3 additions & 5 deletions crates/red_knot/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::panic::{AssertUnwindSafe, RefUnwindSafe};
use std::sync::Arc;

use salsa::Cancelled;

use red_knot_module_resolver::{vendored_typeshed_stubs, Db as ResolverDb};
use red_knot_python_semantic::Db as SemanticDb;
Expand All @@ -10,6 +7,7 @@ use ruff_db::program::{Program, ProgramSettings};
use ruff_db::system::System;
use ruff_db::vendored::VendoredFileSystem;
use ruff_db::{Db as SourceDb, Upcast};
use salsa::Cancelled;

use crate::lint::Diagnostics;
use crate::workspace::{check_file, Workspace, WorkspaceMetadata};
Expand All @@ -24,7 +22,7 @@ pub struct RootDatabase {
workspace: Option<Workspace>,
storage: salsa::Storage<RootDatabase>,
files: Files,
system: Arc<dyn System + Send + Sync + RefUnwindSafe>,
system: Box<dyn System + Send + Sync + RefUnwindSafe>,
}

impl RootDatabase {
Expand All @@ -36,7 +34,7 @@ impl RootDatabase {
workspace: None,
storage: salsa::Storage::default(),
files: Files::default(),
system: Arc::new(system),
system: Box::new(system),
};

let workspace = Workspace::from_metadata(&db, workspace);
Expand Down
Loading

0 comments on commit 966563c

Please sign in to comment.