nblockchain/fantomless

Bad formatting of nested functions

aarani opened this issue · 0 comments

aarani commented

// 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