Skip to content
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

New rule FavourNestedFunctions #638

Open
knocte opened this issue Dec 19, 2023 · 0 comments · May be fixed by #648
Open

New rule FavourNestedFunctions #638

knocte opened this issue Dec 19, 2023 · 0 comments · May be fixed by #648

Comments

@knocte
Copy link
Collaborator

knocte commented Dec 19, 2023

Testcases:

let Foo () =
    ()

let Bar () =
    ()

=> No errors

let private Foo () =
    ()

let Bar () =
    ()

=> No errors

let private Foo () =
    ()

let Bar () =
    Foo()
    ()

=> Error! (because Foo can be transformed from private to nested)

let Bar () =
    let Foo() =
        ()

    Foo()
    ()

=> no error (because Foo is nested)

let private Foo () =
    ()

let Bar () =
    Foo()
    ()

let Baz () =
    Foo ()
    ()

=> no error (because Foo is called by 2 functions: Bar and Baz; therefore, it cannot become nested)

webwarrior-ws added a commit to webwarrior-ws/FSharpLint that referenced this issue Dec 21, 2023
Implemented FavourNestedFunctions rule. Added rule text message
to Text.resx.

Fixes fsprojects#638
@webwarrior-ws webwarrior-ws linked a pull request Dec 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant