Giter Club home page Giter Club logo

yanalyzers's People

Contributors

youssef1313 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

yanalyzers's Issues

The fixer for Y0002 does not do anything for generics

Maybe this is a known limitation? var myList = Array.Empty<string>().ToList(); will suggest to use an explicit type, but the fixer does nothing, I'd hoped for a suggested change to List<string> myList = Array.Empty<string>().ToList(); .

(Yes one can argue that the type really is apparent here, but that's not the point. I just wanted a simple one-liner to demonstrate that the fixer doesn't do what I hoped).

New analyzer: Flag public methods in test classes that doesn't have a test attribute.

xUnit

Whenever there is a class containing at least a method with [Fact] or [Theory], ensure all other public methods having one of these attributes.

MSTest

Analyze classes marked with [TestClass] and look for any missing [TestMethod] (or [DataSource]) on a public method.

NUnit

Analyze classes marked with [TestFixture] and look for any missing [Test] or [Theory].

Y0002 codefix crash for 'foreach (var (a, b) in x)'

StackTrace:

System.NullReferenceException : Object reference not set to an instance of an object.
   at Microsoft.CodeAnalysis.CSharp.Extensions.ITypeSymbolExtensions.GenerateTypeSyntax(INamespaceOrTypeSymbol symbol,Boolean nameSyntax,Boolean allowVar)
   at Microsoft.CodeAnalysis.CSharp.CodeGeneration.CSharpSyntaxGenerator.TypeExpression(ITypeSymbol typeSymbol)
   at async YAnalyzers.CSharp.UseImplicitOrExplicitTypeCodeFix.UseExplicitTypeAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass11_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)

The form foreach (var (a, b) in x) should be converted into foreach ((TypeA a, TypeB b) in x)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.