Skip to content

Commit 8abde35

Browse files
authored
fix(coverage): filter vy and vyi (#11909)
1 parent 72d2ee9 commit 8abde35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/forge/src/cmd/coverage.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use eyre::Result;
1111
use foundry_cli::utils::{LoadConfig, STATIC_FUZZ_SEED};
1212
use foundry_common::{compile::ProjectCompiler, errors::convert_solar_errors};
1313
use foundry_compilers::{
14-
Artifact, ArtifactId, Project, ProjectCompileOutput, ProjectPathsConfig,
14+
Artifact, ArtifactId, Project, ProjectCompileOutput, ProjectPathsConfig, VYPER_EXTENSIONS,
1515
artifacts::{CompactBytecode, CompactDeployedBytecode, SolcLanguage, sourcemap::SourceMap},
1616
};
1717
use foundry_config::Config;
@@ -192,7 +192,11 @@ impl CoverageArgs {
192192
let mut versioned_sources = HashMap::<Version, SourceFiles>::default();
193193
for (path, source_file, version) in output.output().sources.sources_with_version() {
194194
// Filter out vyper sources.
195-
if path.extension().is_some_and(|e| e.to_str() == Some("vy")) {
195+
if path
196+
.extension()
197+
.and_then(|s| s.to_str())
198+
.is_some_and(|ext| VYPER_EXTENSIONS.contains(&ext))
199+
{
196200
continue;
197201
}
198202

0 commit comments

Comments
 (0)