-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add analyzers from FSharp.Formatting PR #85
Conversation
I have more suggestions if you run out :-D
|
Thanks, that is good input. Realistically speaking I'll probably not get to those. |
I'm sure there are plenty of possible ideas for analyzers about (be it borrowing more rules from FSharpLint, or looking at things like NetAnalyzers and Roslynator, or more F# specific stuff) - is it worth creating a more general list of suggestions somewhere to track ideas? |
Not to throw shade, but who's actually gonna make it happen, right? 😉 Just forecasting the vibes, not trying to be harsh. |
Something that ionide-analysers could in theory do, and not so much of others (just because they are not F# IDE-plugins), would be these 2 way conversions of "change A to B" and "change B to A" and leave final decision for user to decide. Because that would help refactorings. |
@dawedawe feel free to already start nitpicking if you like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very solid work!
tests/Ionide.Analyzers.Tests/Suggestion/StructDiscriminatedUnionAnalyzerTests.fs
Outdated
Show resolved
Hide resolved
I've noticed the issue as well. Ideally, the quick fix should address this. I'm inclined to accept the quick fix as it stands. While it's not ideal, anyone interested can further refine it with subsequent PRs. I feel this option might be the better choice compared to turning off the code fix and nobody ever touches it again. This PR's work is supported by the Amplifying F# Open Collective (more details to be shared publicly later this week). We allocated one working day for this task, and we've now surpassed that limit. I'll be shifting my focus to other work that supports my livelihood. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. You really squeezed the funding to the max. Thanks!
The known limitations should be handled in another round.
In fsprojects/FSharp.Formatting#906, @Thorium made some good suggestions to improve the performance of the code.
Some of these checks are interesting to turn into an analyzer I think.
I will try and add some analyzers in this PR.
list = []
analyzer (should beList.empty
)[<return: Struct>]
on (partial) active pattern.List.map
piped toList.map
call.a = null
, should beisNull a
a <> null
should benot (isNull a)
[<Struct>]
to DU when it makes sense. (For example each DU case does not have any fields)