Skip to content

IO0003 false positive if IDirectory is used #8

@hangy

Description

@hangy

Thanks for writing analyzers for this! In Roslyn.System.IO.Abstractions.Analyzers v4.0.2, I get a false positive for IO0003 using the following code:

namespace Foobar
{
    using System.Collections.Generic;
    using System.IO;
    using System.IO.Abstractions;
    using System.Linq;

    internal static class DirectoryExtensions
    {
        public static IEnumerable<string> GetJpegs(this IDirectory directory, string path) => directory.EnumerateFiles(path, "*.jpeg", SearchOption.TopDirectoryOnly).Union(
                directory.EnumerateFiles(path, "*.jpg", SearchOption.TopDirectoryOnly));
    }
}

Metadata

Metadata

Assignees

Labels

False PositiveErroneously detected code snippet

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions