-
Notifications
You must be signed in to change notification settings - Fork 73
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
favourStaticEmptyFields: the suggestion of empty arrays is incorrect #630
Comments
webwarrior-ws
added a commit
to webwarrior-ws/FSharpLint
that referenced
this issue
Dec 13, 2023
Simplified code and fixed bug in FavourStaticEmptyFields rule. Fixes fsprojects#630
webwarrior-ws
added a commit
to webwarrior-ws/FSharpLint
that referenced
this issue
Dec 13, 2023
Simplified code and fixed bug in FavourStaticEmptyFields rule. Fixes fsprojects#630
webwarrior-ws
added a commit
to webwarrior-ws/FSharpLint
that referenced
this issue
Dec 13, 2023
Simplified code and fixed bug in FavourStaticEmptyFields rule. Fixes fsprojects#630
webwarrior-ws
added a commit
to webwarrior-ws/FSharpLint
that referenced
this issue
Dec 13, 2023
Simplified code and fixed bug in FavourStaticEmptyFields rule. Fixes fsprojects#630
webwarrior-ws
added a commit
to webwarrior-ws/FSharpLint
that referenced
this issue
Dec 14, 2023
Fixed bug in FavourStaticEmptyFields rule that caused wrong suggestion for arrays (List.Empty instead of Array.empty). Fixes fsprojects#630
webwarrior-ws
added a commit
to webwarrior-ws/FSharpLint
that referenced
this issue
Dec 14, 2023
Simplified FavourStaticEmptyFields rule by removing unnecessary code. Fixes fsprojects#630
knocte
added a commit
that referenced
this issue
Dec 14, 2023
* Added checks for error message containing substitution that is appropriate for given data type (array or list) in FavourStaticEmptyFields tests. E.g. Array.empty should be suggested for replacing [||]. * Fixed bug in FavourStaticEmptyFields rule that caused wrong suggestion for arrays. * Simplified FavourStaticEmptyFields rule by removing unnecessary code. Fixes #630
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Make sure favourStaticEmptyFields is enabled in fsharplint.json.
FSharpLint suggests using
List.Empty
, which is wrong since it's not a List. Instead, it should suggest usingArray.empty
.Steps To Reproduce
dotnet fsharplint lint ..\ConsoleApp\ConsoleApp\ConsoleApp.fsproj
ConsoleApp.fsproj
Program.fs
Current Results
Expected behavior
FsharpLint is expected to suggest to use Array.empty.
Related information
The text was updated successfully, but these errors were encountered: