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

Bad formatting of nested functions #9

Open
aarani opened this issue Apr 28, 2023 · 0 comments
Open

Bad formatting of nested functions #9

aarani opened this issue Apr 28, 2023 · 0 comments

Comments

@aarani
Copy link

aarani commented Apr 28, 2023

// TODO: create minimal test case
Testcase location: aarani/NOnion@5c1818e#diff-84bc2676d83024ec1f393eca9ce3a3ca06bca5bf36753c90c252f4c9f020c296R179

Expected behavior:

    member self.GetRouter(filter: RouterType) =
        async {
            do! self.UpdateConsensusIfNotLive()
            let randomServerOpt =
                self.NetworkStatus.Routers
                |> match filter with
                   | Normal -> Seq.ofList
                   | Directory ->
                       Seq.filter(fun router ->
                           router.DirectoryPort.IsSome
                           && router.DirectoryPort.Value > 0
                       )
                   | Guard ->
                       Seq.filter(fun router ->
                           Seq.contains "Guard" router.Flags
                       )
                   | Exit ->
                       Seq.filter(fun router ->
                           Seq.contains "Exit" router.Flags
                       )
                |> SeqUtils.TakeRandom 1
                |> Seq.tryHead

Actual behavior:

    member self.GetRouter(filter: RouterType) =
        async {
            do! self.UpdateConsensusIfNotLive()
            let randomServerOpt =
                self.NetworkStatus.Routers
                |> match filter with
                   | Normal -> Seq.ofList
                   | Directory ->
                       Seq.filter(fun router ->
                           router.DirectoryPort.IsSome
                           && router.DirectoryPort.Value > 0
                       )
                   | Guard ->
                       Seq.filter(fun router ->
                           Seq.contains "Guard" router.Flags
                       )
                   | Exit ->
                       Seq.filter(fun router -> Seq.contains "Exit" router.Flags
                       )
                |> SeqUtils.TakeRandom 1
                |> Seq.tryHead

Configuration: https://github.com/aarani/NOnion/blob/5c1818e73179d65a8cb5c082b4dcec6dd2d26c3e/.editorconfig

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

No branches or pull requests

1 participant