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
34 changes: 34 additions & 0 deletions .devcontainer/default/container/.gitconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[init]
defaultBranch = main
[diff]
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[push]
default = simple
autoSetupRemote = true
followTags = true
[fetch]
prune = true
pruneTags = true
all = true

[help]
autocorrect = prompt
[commit]
verbose = true
[rerere]
enabled = true
autoupdate = true
[rebase]
autoSquash = true
autoStash = true
updateRefs = true

[alias]
lol = log --oneline --graph
lola = log --oneline --graph --all
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix infinite loops in export * expansion",
"packageName": "@good-fences/api",
"email": "[email protected]",
"dependentChangeType": "patch"
}
48 changes: 48 additions & 0 deletions crates/unused_finder/src/parse/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,54 @@ impl ResolvedImportExportInfo {
.chain(re_exports)
.chain(executed_paths)
}

/// Test helper that gets a copy of this ImportExportInfo with all spans
/// zeroed.
pub fn with_zeroed_spans(&self) -> Self {
let exported_ids = self
.exported_ids
.iter()
.map(|(symbol, meta)| {
(
symbol.clone(),
ExportedSymbolMetadata {
span: Span::default(),
..meta.clone()
},
)
})
.collect();
let export_from_symbols = self
.export_from_symbols
.iter()
.map(|(path, symbols)| {
(
path.clone(),
symbols
.iter()
.map(|(symbol, meta)| {
(
symbol.clone(),
ExportedSymbolMetadata {
span: Span::default(),
..meta.clone()
},
)
})
.collect(),
)
})
.collect();

Self {
exported_ids,
export_from_symbols,
imported_symbols: self.imported_symbols.clone(),
require_paths: self.require_paths.clone(),
imported_paths: self.imported_paths.clone(),
executed_paths: self.executed_paths.clone(),
}
}
}

#[derive(Debug, Eq, PartialEq, Clone, Hash, Default)]
Expand Down
Loading