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

Not adding a space even when all SpaceBefore* settings are enabled #964

Closed
1 of 3 tasks
knocte opened this issue Jul 13, 2020 · 16 comments · Fixed by #1245
Closed
1 of 3 tasks

Not adding a space even when all SpaceBefore* settings are enabled #964

knocte opened this issue Jul 13, 2020 · 16 comments · Fixed by #1245

Comments

@knocte
Copy link
Contributor

knocte commented Jul 13, 2020

Issue created from fantomas-online

Code

type ProtocolGlitchException =
    inherit CommunicationUnsuccessfulException

    new(message) = { inherit CommunicationUnsuccessfulException(message) }

    new(message: string, innerException: Exception) =
        { inherit CommunicationUnsuccessfulException(message, innerException) }

Result

type ProtocolGlitchException =
    inherit CommunicationUnsuccessfulException

    new(message) = { inherit CommunicationUnsuccessfulException(message) }

    new(message: string, innerException: Exception) =
        { inherit CommunicationUnsuccessfulException(message, innerException) }

Expected Result

type ProtocolGlitchException =
    inherit CommunicationUnsuccessfulException

    new (message) = { inherit CommunicationUnsuccessfulException (message) }

    new (message: string, innerException: Exception) =
        { inherit CommunicationUnsuccessfulException (message, innerException) }

Problem description

To be consistent with fantomas behaviour when all SpaceBefore* settings are enabled, the last code fragment above should have been the formatting result.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas Master at 07/11/2020 18:08:27 - a67f3a3

Name Value
IndentSize 4
MaxLineLength 120
SemicolonAtEndOfLine false
SpaceBeforeParameter true
SpaceBeforeLowercaseInvocation true
SpaceBeforeUppercaseInvocation true
SpaceBeforeClassConstructor true
SpaceBeforeMember true
SpaceBeforeColon false
SpaceAfterComma true
SpaceBeforeSemicolon false
SpaceAfterSemicolon true
IndentOnTryWith false
SpaceAroundDelimiter true
MaxIfThenElseShortWidth 40
MaxInfixOperatorExpression 50
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxValueBindingWidth 40
MaxFunctionBindingWidth 40
MultilineBlockBracketsOnSameColumn false
NewlineBetweenTypeDefinitionAndMembers false
KeepIfThenInSameLine false
MaxElmishWidth 40
SingleArgumentWebMode false
AlignFunctionSignatureToIndentation false
AlternativeLongMemberDefinitions false
StrictMode false
knocte added a commit to nblockchain/geewallet that referenced this issue Jul 20, 2020
This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-012

Source will be formatted using this command:
fantomas --recurse src/GWallet.Backend/

Things that would need to be fixed manually before merging this to master:
- We can drop parens in many if statements, e.g.: StratumClient.fs'
CreateVersion's, ServerManager.fs' GetDummyBalanceAction, FTPC.fs'
FTPC type, EtherAccount.fs' GetTransactionCount
- Drop parents in ReadAllText calls of Account.fs
- Many raise lines should use <|, e.g. in WarpKey.fs, UtxoCoinAccount.fs,
and ElectrumServer.fs
- UtxoCoinAccount.fs' EstimateFees unneeded use of |> with 'head'

Fantomas issues from geewallet's wishlist:
- fsprojects/fantomas#712
- fsprojects/fantomas#908
- fsprojects/fantomas#684
- fsprojects/fantomas#964

Issues not yet reported:
- There should be a setting called AlwaysSplitPipeOperatorInNewLine
- MaxLineLength not being respected? look at how long some lines in
UtxoCoinAccount.fs' GetAccountFromFile are.
- UtxoCoinAccount.fs' TransactionOutpoint.ToCoin() should start on next
line.
- Why cut `truncated` var assignment in Formatting.fs'
DecimalAmountTruncating func?
- FaultTolerantParallelClient.fs' Runner.Run is tooooooo long
- Moving commend comment of FTPC.fs' CustomCancelSource's Dispose func
- This stupid diff adding an unneeded space:
```
             return! faultTolerantEtherClient.Query
                         (FaultTolerantParallelClientDefaultSettings
                             ServerSelectionMode.Fast
-                            currency
-                            (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
+                             currency
+                             (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
                         web3Funcs
```
- This stupid 3-space indentation:
```
-                if not (account.Currency.IsEtherBased()) then
-                    failwith <| SPrintF1 "Currency %A not ether based and not UTXO either? not supported, report this bug (estimatefee)"
-                        account.Currency
+                if not (account.Currency.IsEtherBased ()) then
+                    failwith
+                    <| SPrintF1
+                        "Currency %A not ether based and not UTXO either? not supported, report this bug (estimatefee)"
+                           account.Currency
```
- (Investigate) FSharpUtil.option{} that contains a `do! if...`, WAT
- Excessive EOLs in ElectrumClient.fs (one extra addition I didn't even add
to this commit)

Last but not least, investigate if alpha-012 contains unwanted things like
311bff817f89f8b47c0799eb7474da886175ef15, otherwise we might need to go
back to 04c48d5, which should be
alpha-011 with these fantomas-config.json settings:
{
  "IndentSpaceNum":4,
  "PageWidth":80,
  "SemicolonAtEndOfLine":false,
  "SpaceBeforeParameter":true,
  "SpaceBeforeLowercaseInvocation":true,
  "SpaceBeforeUppercaseInvocation":true,
  "SpaceBeforeClassConstructor":true,
  "SpaceBeforeMember":true,
  "SpaceBeforeColon":false,
  "SpaceAfterComma":true,
  "SpaceBeforeSemicolon":false,
  "SpaceAfterSemicolon":true,
  "IndentOnTryWith":true,
  "SpaceAroundDelimiter":true,
  "MaxIfThenElseShortWidth":0,
  "MaxInfixOperatorExpression":80,
  "MaxRecordWidth":0,
  "MaxFunctionBindingWidth":0,
  "MaxValueBindingWidth":80,
  "MultilineBlockBracketsOnSameColumn":true,
  "NewlineBetweenTypeDefinitionAndMembers":true,
  "KeepIfThenInSameLine":true,
  "StrictMode":false
}
knocte added a commit to nblockchain/geewallet that referenced this issue Jul 20, 2020
This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-012

Source will be formatted using this command:
fantomas --recurse src/GWallet.Backend/

Things that would need to be fixed manually before merging this to master:
- We can drop parens in many if statements, e.g.: StratumClient.fs'
CreateVersion's, ServerManager.fs' GetDummyBalanceAction, FTPC.fs'
FTPC type, EtherAccount.fs' GetTransactionCount
- Drop parents in ReadAllText calls of Account.fs
- Many raise lines should use <|, e.g. in WarpKey.fs, UtxoCoinAccount.fs,
and ElectrumServer.fs
- UtxoCoinAccount.fs' EstimateFees unneeded use of |> with 'head'

Fantomas issues from geewallet's wishlist:
- fsprojects/fantomas#712
- fsprojects/fantomas#908
- fsprojects/fantomas#684
- fsprojects/fantomas#964

Issues not yet reported:
- There should be a setting called AlwaysSplitPipeOperatorInNewLine
- MaxLineLength not being respected? look at how long some lines in
UtxoCoinAccount.fs' GetAccountFromFile are.
- UtxoCoinAccount.fs' TransactionOutpoint.ToCoin() should start on next
line.
- Why cut `truncated` var assignment in Formatting.fs'
DecimalAmountTruncating func?
- FaultTolerantParallelClient.fs' Runner.Run is tooooooo long
- Moving commend comment of FTPC.fs' CustomCancelSource's Dispose func
- This stupid diff adding an unneeded space:
```
             return! faultTolerantEtherClient.Query
                         (FaultTolerantParallelClientDefaultSettings
                             ServerSelectionMode.Fast
-                            currency
-                            (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
+                             currency
+                             (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
                         web3Funcs
```
- This stupid 3-space indentation:
```
-                if not (account.Currency.IsEtherBased()) then
-                    failwith <| SPrintF1 "Currency %A not ether based and not UTXO either? not supported, report this bug (estimatefee)"
-                        account.Currency
+                if not (account.Currency.IsEtherBased ()) then
+                    failwith
+                    <| SPrintF1
+                        "Currency %A not ether based and not UTXO either? not supported, report this bug (estimatefee)"
+                           account.Currency
```
- (Investigate) FSharpUtil.option{} that contains a `do! if...`, WAT
- Excessive EOLs in ElectrumClient.fs (one extra addition I didn't even add
to this commit)
- In a lock() statement, it should allow placing the ending `)` in its own
line at the end, in the same column where `lock` starts.

Last but not least, investigate if alpha-012 contains unwanted things like
311bff817f89f8b47c0799eb7474da886175ef15, otherwise we might need to go
back to 04c48d5, which should be
alpha-011 with these fantomas-config.json settings:
{
  "IndentSpaceNum":4,
  "PageWidth":80,
  "SemicolonAtEndOfLine":false,
  "SpaceBeforeParameter":true,
  "SpaceBeforeLowercaseInvocation":true,
  "SpaceBeforeUppercaseInvocation":true,
  "SpaceBeforeClassConstructor":true,
  "SpaceBeforeMember":true,
  "SpaceBeforeColon":false,
  "SpaceAfterComma":true,
  "SpaceBeforeSemicolon":false,
  "SpaceAfterSemicolon":true,
  "IndentOnTryWith":true,
  "SpaceAroundDelimiter":true,
  "MaxIfThenElseShortWidth":0,
  "MaxInfixOperatorExpression":80,
  "MaxRecordWidth":0,
  "MaxFunctionBindingWidth":0,
  "MaxValueBindingWidth":80,
  "MultilineBlockBracketsOnSameColumn":true,
  "NewlineBetweenTypeDefinitionAndMembers":true,
  "KeepIfThenInSameLine":true,
  "StrictMode":false
}
knocte added a commit to nblockchain/geewallet that referenced this issue Jul 20, 2020
This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-012

Source will be formatted using this command:
fantomas --recurse src/GWallet.Backend/

Things that would need to be fixed manually before merging this to master:
- We can drop parens in many if statements, e.g.: StratumClient.fs'
CreateVersion's, ServerManager.fs' GetDummyBalanceAction, FTPC.fs'
FTPC type, EtherAccount.fs' GetTransactionCount
- Drop parents in ReadAllText calls of Account.fs
- Many raise lines should use <|, e.g. in WarpKey.fs, UtxoCoinAccount.fs,
and ElectrumServer.fs
- UtxoCoinAccount.fs' EstimateFees unneeded use of |> with 'head'

Fantomas issues from geewallet's wishlist:
- fsprojects/fantomas#712
- fsprojects/fantomas#908
- fsprojects/fantomas#684
- fsprojects/fantomas#964

Issues not yet reported:
- There should be a setting called AlwaysSplitPipeOperatorInNewLine? but I actually don't understand
the consistency of this:
```
        use webClient = new WebClient()
        let serverListInJson = webClient.DownloadString urlToElectrumJsonFile
        ExtractServerListFromElectrumJsonFile serverListInJson
-           |> Seq.filter FilterCompatibleServer
+       |> Seq.filter FilterCompatibleServer

-    let DefaultBtcList =
-        Caching.Instance.GetServers Currency.BTC
-            |> List.ofSeq
+    let DefaultBtcList = Caching.Instance.GetServers Currency.BTC |> List.ofSeq
```
- MaxLineLength not being respected? look at how long some lines in
UtxoCoinAccount.fs' GetAccountFromFile are.
- UtxoCoinAccount.fs' TransactionOutpoint.ToCoin() should start on next
line.
- Why cut `truncated` var assignment in Formatting.fs'
DecimalAmountTruncating func?
- FaultTolerantParallelClient.fs' Runner.Run is tooooooo long
- Moving commend comment of FTPC.fs' CustomCancelSource's Dispose func
- This stupid diff adding an unneeded space:
```
             return! faultTolerantEtherClient.Query
                         (FaultTolerantParallelClientDefaultSettings
                             ServerSelectionMode.Fast
-                            currency
-                            (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
+                             currency
+                             (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
                         web3Funcs
```
- This stupid 3-space indentation:
```
-                if not (account.Currency.IsEtherBased()) then
-                    failwith <| SPrintF1 "Currency %A not ether based and not UTXO either? not supported, report this bug (estimatefee)"
-                        account.Currency
+                if not (account.Currency.IsEtherBased ()) then
+                    failwith
+                    <| SPrintF1
+                        "Currency %A not ether based and not UTXO either? not supported, report this bug (estimatefee)"
+                           account.Currency
```
- (Investigate) FSharpUtil.option{} that contains a `do! if...`, WAT
- Excessive EOLs in ElectrumClient.fs (one extra addition I didn't even add
to this commit)
- In a lock() statement, it should allow placing the ending `)` in its own
line at the end, in the same column where `lock` starts.

Last but not least, investigate if alpha-012 contains unwanted things like
311bff817f89f8b47c0799eb7474da886175ef15, otherwise we might need to go
back to 04c48d5, which should be
alpha-011 with these fantomas-config.json settings:
{
  "IndentSpaceNum":4,
  "PageWidth":80,
  "SemicolonAtEndOfLine":false,
  "SpaceBeforeParameter":true,
  "SpaceBeforeLowercaseInvocation":true,
  "SpaceBeforeUppercaseInvocation":true,
  "SpaceBeforeClassConstructor":true,
  "SpaceBeforeMember":true,
  "SpaceBeforeColon":false,
  "SpaceAfterComma":true,
  "SpaceBeforeSemicolon":false,
  "SpaceAfterSemicolon":true,
  "IndentOnTryWith":true,
  "SpaceAroundDelimiter":true,
  "MaxIfThenElseShortWidth":0,
  "MaxInfixOperatorExpression":80,
  "MaxRecordWidth":0,
  "MaxFunctionBindingWidth":0,
  "MaxValueBindingWidth":80,
  "MultilineBlockBracketsOnSameColumn":true,
  "NewlineBetweenTypeDefinitionAndMembers":true,
  "KeepIfThenInSameLine":true,
  "StrictMode":false
}
@nojaf
Copy link
Contributor

nojaf commented Aug 7, 2020

You would expect the extra space would be there because of the SpaceBeforeClassConstructor setting?
If so we can use sepSpaceBeforeClassConstructor somewhere in the CodePrinter.

@knocte
Copy link
Contributor Author

knocte commented Aug 7, 2020

because of the SpaceBeforeClassConstructor setting?

I guess so. Would this apply to both inherit Foo (bar) and new (bar) elements?

@nojaf
Copy link
Contributor

nojaf commented Aug 7, 2020

We can do this yes, this is a case that just hasn't been brought up yet until now I think.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 130.0 DAI (130.0 USD @ $1.0/DAI) attached to it.

knocte added a commit to nblockchain/geewallet that referenced this issue Nov 6, 2020
This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-012

Source will be formatted using this command:
fantomas --recurse src/GWallet.Backend/

Things that would need to be fixed manually before merging this to master:
- We can drop parens in many if statements, e.g.: StratumClient.fs'
CreateVersion's, ServerManager.fs' GetDummyBalanceAction, FTPC.fs'
FTPC type, EtherAccount.fs' GetTransactionCount
- Drop parents in ReadAllText calls of Account.fs
- Many raise lines should use <|, e.g. in WarpKey.fs, UtxoCoinAccount.fs,
and ElectrumServer.fs
- UtxoCoinAccount.fs' EstimateFees unneeded use of |> with 'head'

Fantomas issues from geewallet's wishlist:
- fsprojects/fantomas#712
- fsprojects/fantomas#684
- fsprojects/fantomas#964
- fsprojects/fantomas#1218

Issues not yet reported:
- There should be a setting called AlwaysSplitPipeOperatorInNewLine? but I actually don't understand
the consistency of this:
```
        use webClient = new WebClient()
        let serverListInJson = webClient.DownloadString urlToElectrumJsonFile
        ExtractServerListFromElectrumJsonFile serverListInJson
-           |> Seq.filter FilterCompatibleServer
+       |> Seq.filter FilterCompatibleServer

-    let DefaultBtcList =
-        Caching.Instance.GetServers Currency.BTC
-            |> List.ofSeq
+    let DefaultBtcList = Caching.Instance.GetServers Currency.BTC |> List.ofSeq
```
- MaxLineLength not being respected? look at how long some lines in
UtxoCoinAccount.fs' GetAccountFromFile are.
- UtxoCoinAccount.fs' TransactionOutpoint.ToCoin() should start on next
line.
- Why cut `truncated` var assignment in Formatting.fs'
DecimalAmountTruncating func?
- FaultTolerantParallelClient.fs' Runner.Run is tooooooo long
- Moving comment of FTPC.fs' CustomCancelSource's Dispose func
- This stupid diff adding an unneeded space:
```
             return! faultTolerantEtherClient.Query
                         (FaultTolerantParallelClientDefaultSettings
                             ServerSelectionMode.Fast
-                            currency
-                            (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
+                             currency
+                             (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
                         web3Funcs
```
- (Investigate) FSharpUtil.option{} that contains a `do! if...`, WAT
- In a lock() statement, it should allow placing the ending `)` in its own
line at the end, in the same column where `lock` starts.

Last but not least, investigate if alpha-012 contains unwanted things like
311bff817f89f8b47c0799eb7474da886175ef15, otherwise we might need to go
back to 04c48d5, which should be
alpha-011 with these fantomas-config.json settings:
{
  "IndentSpaceNum":4,
  "PageWidth":80,
  "SemicolonAtEndOfLine":false,
  "SpaceBeforeParameter":true,
  "SpaceBeforeLowercaseInvocation":true,
  "SpaceBeforeUppercaseInvocation":true,
  "SpaceBeforeClassConstructor":true,
  "SpaceBeforeMember":true,
  "SpaceBeforeColon":false,
  "SpaceAfterComma":true,
  "SpaceBeforeSemicolon":false,
  "SpaceAfterSemicolon":true,
  "IndentOnTryWith":true,
  "SpaceAroundDelimiter":true,
  "MaxIfThenElseShortWidth":0,
  "MaxInfixOperatorExpression":80,
  "MaxRecordWidth":0,
  "MaxFunctionBindingWidth":0,
  "MaxValueBindingWidth":80,
  "MultilineBlockBracketsOnSameColumn":true,
  "NewlineBetweenTypeDefinitionAndMembers":true,
  "KeepIfThenInSameLine":true,
  "StrictMode":false
}
knocte added a commit to nblockchain/geewallet that referenced this issue Nov 6, 2020
This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-012

Source will be formatted using this command:
fantomas --recurse src/GWallet.Backend/

Things that would need to be fixed manually before merging this to master:
- We can drop parens in many if statements, e.g.: StratumClient.fs'
CreateVersion's, ServerManager.fs' GetDummyBalanceAction, FTPC.fs'
FTPC type, EtherAccount.fs' GetTransactionCount
- Drop parents in ReadAllText calls of Account.fs
- Many raise lines should use <|, e.g. in WarpKey.fs, UtxoCoinAccount.fs,
and ElectrumServer.fs
- UtxoCoinAccount.fs' EstimateFees unneeded use of |> with 'head'

Fantomas issues from geewallet's wishlist:
- fsprojects/fantomas#712
- fsprojects/fantomas#684
- fsprojects/fantomas#964
- fsprojects/fantomas#1218
- fsprojects/fantomas#815 or
fsprojects/fantomas#1221 (but 815 preferred)

Issues not yet reported:
- There should be a setting called AlwaysSplitPipeOperatorInNewLine? but I actually don't understand
the consistency of this:
```
        use webClient = new WebClient()
        let serverListInJson = webClient.DownloadString urlToElectrumJsonFile
        ExtractServerListFromElectrumJsonFile serverListInJson
-           |> Seq.filter FilterCompatibleServer
+       |> Seq.filter FilterCompatibleServer

-    let DefaultBtcList =
-        Caching.Instance.GetServers Currency.BTC
-            |> List.ofSeq
+    let DefaultBtcList = Caching.Instance.GetServers Currency.BTC |> List.ofSeq
```
- MaxLineLength not being respected? look at how long some lines in
UtxoCoinAccount.fs' GetAccountFromFile are.
- UtxoCoinAccount.fs' TransactionOutpoint.ToCoin() should start on next
line.
- Why cut `truncated` var assignment in Formatting.fs'
DecimalAmountTruncating func?
- FaultTolerantParallelClient.fs' Runner.Run is tooooooo long
- Moving comment of FTPC.fs' CustomCancelSource's Dispose func
- This stupid diff adding an unneeded space:
```
             return! faultTolerantEtherClient.Query
                         (FaultTolerantParallelClientDefaultSettings
                             ServerSelectionMode.Fast
-                            currency
-                            (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
+                             currency
+                             (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
                         web3Funcs
```
- (Investigate) FSharpUtil.option{} that contains a `do! if...`, WAT
- In a lock() statement, it should allow placing the ending `)` in its own
line at the end, in the same column where `lock` starts.

Last but not least, investigate if alpha-012 contains unwanted things like
311bff817f89f8b47c0799eb7474da886175ef15, otherwise we might need to go
back to 04c48d5, which should be
alpha-011 with these fantomas-config.json settings:
{
  "IndentSpaceNum":4,
  "PageWidth":80,
  "SemicolonAtEndOfLine":false,
  "SpaceBeforeParameter":true,
  "SpaceBeforeLowercaseInvocation":true,
  "SpaceBeforeUppercaseInvocation":true,
  "SpaceBeforeClassConstructor":true,
  "SpaceBeforeMember":true,
  "SpaceBeforeColon":false,
  "SpaceAfterComma":true,
  "SpaceBeforeSemicolon":false,
  "SpaceAfterSemicolon":true,
  "IndentOnTryWith":true,
  "SpaceAroundDelimiter":true,
  "MaxIfThenElseShortWidth":0,
  "MaxInfixOperatorExpression":80,
  "MaxRecordWidth":0,
  "MaxFunctionBindingWidth":0,
  "MaxValueBindingWidth":80,
  "MultilineBlockBracketsOnSameColumn":true,
  "NewlineBetweenTypeDefinitionAndMembers":true,
  "KeepIfThenInSameLine":true,
  "StrictMode":false
}
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 266 years from now.
Please review their action plans below:

1) btzo has been approved to start work.

  • add tests to validate the new case. Create a new file in Fantomas.Tests or check if the case already applies to one of the test files (SpaceBeforeClassConstructorTests.fs can be a candidate)
  • analyze the locations in CodePrinter.fs where sepSpaceBeforeClassConstructor can be added when
    SpaceBeforeClassConstructor is set
  • read the two F # style guides to see if the change doesn't apply to other cases
  • rerun all tests and ensure that all work as before together with the new ones

Do I need to consider any changes outside the cited files?

Learn more on the Gitcoin Issue Details page.

knocte added a commit to nblockchain/geewallet that referenced this issue Nov 10, 2020
This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-012

Source will be formatted using this command:
fantomas --recurse src/GWallet.Backend/

Things that would need to be fixed manually before merging this to master:
- We can drop parens in many if statements, e.g.: StratumClient.fs'
CreateVersion's, ServerManager.fs' GetDummyBalanceAction, FTPC.fs'
FTPC type, EtherAccount.fs' GetTransactionCount
- Drop parents in ReadAllText calls of Account.fs
- Many raise lines should use <|, e.g. in WarpKey.fs, UtxoCoinAccount.fs,
and ElectrumServer.fs
- UtxoCoinAccount.fs' EstimateFees unneeded use of |> with 'head'

Fantomas issues from geewallet's wishlist:
- fsprojects/fantomas#712
- fsprojects/fantomas#684
- fsprojects/fantomas#964
- fsprojects/fantomas#1218
- In a lock() statement, it should allow placing the ending `)` in its own
line at the end, in the same column where `lock` starts:
 fsprojects/fantomas#815 or
fsprojects/fantomas#1221 (but 815 preferred)
- FaultTolerantParallelClient.fs' Runner.Run is tooooooo long:
fsprojects/fantomas#1133
- Moving comment of FTPC.fs' CustomCancelSource's Dispose func:
fsprojects/fantomas#1233

Issues not yet reported:
- There should be a setting called AlwaysSplitPipeOperatorToNewLine?
- MaxLineLength not being respected? look at how long some lines in
UtxoCoinAccount.fs' GetAccountFromFile are.
- UtxoCoinAccount.fs' TransactionOutpoint.ToCoin() should start on next
line.
- This stupid diff adding an unneeded space:
```
             return! faultTolerantEtherClient.Query
                         (FaultTolerantParallelClientDefaultSettings
                             ServerSelectionMode.Fast
-                            currency
-                            (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
+                             currency
+                             (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
                         web3Funcs
```
- (Investigate) FSharpUtil.option{} that contains a `do! if...`, WAT

Last but not least, investigate if alpha-012 contains unwanted things like
311bff817f89f8b47c0799eb7474da886175ef15, otherwise we might need to go
back to 04c48d5, which should be
alpha-011 with these fantomas-config.json settings:
{
  "IndentSpaceNum":4,
  "PageWidth":80,
  "SemicolonAtEndOfLine":false,
  "SpaceBeforeParameter":true,
  "SpaceBeforeLowercaseInvocation":true,
  "SpaceBeforeUppercaseInvocation":true,
  "SpaceBeforeClassConstructor":true,
  "SpaceBeforeMember":true,
  "SpaceBeforeColon":false,
  "SpaceAfterComma":true,
  "SpaceBeforeSemicolon":false,
  "SpaceAfterSemicolon":true,
  "IndentOnTryWith":true,
  "SpaceAroundDelimiter":true,
  "MaxIfThenElseShortWidth":0,
  "MaxInfixOperatorExpression":80,
  "MaxRecordWidth":0,
  "MaxFunctionBindingWidth":0,
  "MaxValueBindingWidth":80,
  "MultilineBlockBracketsOnSameColumn":true,
  "NewlineBetweenTypeDefinitionAndMembers":true,
  "KeepIfThenInSameLine":true,
  "StrictMode":false
}
knocte added a commit to nblockchain/geewallet that referenced this issue Nov 10, 2020
This version of fantomas doesn't crash anymore when formatting it:
dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-012

Source will be formatted using this command:
fantomas --recurse src/GWallet.Backend/

Things that would need to be fixed manually before merging this to master:
- We can drop parens in many if statements, e.g.: StratumClient.fs'
CreateVersion's, ServerManager.fs' GetDummyBalanceAction, FTPC.fs'
FTPC type, EtherAccount.fs' GetTransactionCount
- Drop parents in ReadAllText calls of Account.fs
- Many raise lines should use <|, e.g. in WarpKey.fs, UtxoCoinAccount.fs,
and ElectrumServer.fs
- UtxoCoinAccount.fs' EstimateFees unneeded use of |> with 'head'

Fantomas issues from geewallet's wishlist:
- fsprojects/fantomas#712
- fsprojects/fantomas#684
- fsprojects/fantomas#964
- fsprojects/fantomas#1235
- fsprojects/fantomas#1218
- In a lock() statement, it should allow placing the ending `)` in its own
line at the end, in the same column where `lock` starts:
 fsprojects/fantomas#815 or
fsprojects/fantomas#1221 (but 815 preferred)
- FaultTolerantParallelClient.fs' Runner.Run is tooooooo long:
fsprojects/fantomas#1133
- Moving comment of FTPC.fs' CustomCancelSource's Dispose func:
fsprojects/fantomas#1233

Issues not yet reported:
- There should be a setting called AlwaysSplitPipeOperatorToNewLine?
- MaxLineLength not being respected? look at how long some lines in
UtxoCoinAccount.fs' GetAccountFromFile are.
- UtxoCoinAccount.fs' TransactionOutpoint.ToCoin() should start on next
line -> fixed in v.NEXT
- This stupid diff adding an unneeded space:
```
             return! faultTolerantEtherClient.Query
                         (FaultTolerantParallelClientDefaultSettings
                             ServerSelectionMode.Fast
-                            currency
-                            (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
+                             currency
+                             (Some (AverageBetweenResponses (minResponsesRequired, AverageGasPrice))))
                         web3Funcs
```
(seems to be fixed in v.NEXT)
- (Investigate) FSharpUtil.option{} that contains a `do! if...`, WAT

Last but not least, investigate if alpha-012 contains unwanted things like
311bff817f89f8b47c0799eb7474da886175ef15, otherwise we might need to go
back to 04c48d5, which should be
alpha-011 with these fantomas-config.json settings:
{
  "IndentSpaceNum":4,
  "PageWidth":80,
  "SemicolonAtEndOfLine":false,
  "SpaceBeforeParameter":true,
  "SpaceBeforeLowercaseInvocation":true,
  "SpaceBeforeUppercaseInvocation":true,
  "SpaceBeforeClassConstructor":true,
  "SpaceBeforeMember":true,
  "SpaceBeforeColon":false,
  "SpaceAfterComma":true,
  "SpaceBeforeSemicolon":false,
  "SpaceAfterSemicolon":true,
  "IndentOnTryWith":true,
  "SpaceAroundDelimiter":true,
  "MaxIfThenElseShortWidth":0,
  "MaxInfixOperatorExpression":80,
  "MaxRecordWidth":0,
  "MaxFunctionBindingWidth":0,
  "MaxValueBindingWidth":80,
  "MultilineBlockBracketsOnSameColumn":true,
  "NewlineBetweenTypeDefinitionAndMembers":true,
  "KeepIfThenInSameLine":true,
  "StrictMode":false
}
@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@nojaf nojaf linked a pull request Nov 13, 2020 that will close this issue
@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

8 similar comments
@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@btzo Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 130.0 DAI (130.0 USD @ $1.0/DAI) has been submitted by:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants