Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ publish
*.wasm
*.wat
test.config

8 changes: 8 additions & 0 deletions crates/wit-parser/src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ impl Resolve {
for dep in path.read_dir().context("failed to read directory")? {
let dep = dep.context("failed to read directory iterator")?;
let path = dep.path();

// Files in deps dir are ignored for now to avoid accidentally
// including things like `.DS_Store` files in the call below to
// `parse_dir`.
if path.is_file() {
continue;
}

let pkg = UnresolvedPackage::parse_dir(&path)
.with_context(|| format!("failed to parse package: {}", path.display()))?;
let prev = ret.insert(pkg.name.clone(), pkg);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package foo:bar
interface types {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this file should be ignored by the parser
5 changes: 5 additions & 0 deletions crates/wit-parser/tests/ui/ignore-files-deps/world.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package foo:foo

world foo {
import foo:bar/types
}