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

Quotation escapes removed - Bug report from fantomas-ui #440

Closed
ImaginaryDevelopment opened this issue May 9, 2019 · 0 comments
Closed

Comments

@ImaginaryDevelopment
Copy link

Issue created from fantomas-ui

Please describe here fantomas problem you encountered
With strict mode on, it strips out the Quotation mark escapes, making the code invalid syntax

Code

let toCsv (items:Ipish list):string=
    let formatter =
        // escape commas left in invalid entries
        sprintf "%i,\"%s\""
    items
    |> List.map(function
                |Valid(i,vip)-> formatter i vip.Raw
                |Invalid(i,raw) -> formatter i raw
    )
    |> String.concat System.Environment.NewLine
    |> sprintf "index,value%s%s" System.Environment.NewLine

Result

let toCsv (items : Ipish list) : string =
    let formatter =
        sprintf "%i,"%s""
    items
    |> List.map (function
           | Valid(i, vip) -> formatter i vip.Raw
           | Invalid(i, raw) -> formatter i raw)
    |> String.concat System.Environment.NewLine
    |> sprintf "index,value%s%s" System.Environment.NewLine

Options

Fantomas 2.9.2

Name Value
IndentSpaceNum 4
PageWidth 80
PreserveEndOfLine false
SemicolonAtEndOfLine false
SpaceBeforeArgument true
SpaceBeforeColon true
SpaceAfterComma true
SpaceAfterSemicolon true
IndentOnTryWith false
ReorderOpenDeclaration false
SpaceAroundDelimiter true
StrictMode true
@ImaginaryDevelopment ImaginaryDevelopment changed the title Bug report from fantomas-ui Quotation escapes removed - Bug report from fantomas-ui May 9, 2019
@nojaf nojaf closed this as completed Aug 9, 2019
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

2 participants