Skip to content

Commit

Permalink
Fixes #211 and created release notes for solved issues after 2.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed May 15, 2018
1 parent b2b997e commit 890c5a1
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 18 deletions.
Binary file modified .paket/paket.exe
Binary file not shown.
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#### 2.7.2 - xx-05-2018
* Wrong indentation of `else` after comment [#241](https://github.com/dungpa/fantomas/issues/241)
* Change Content to None [#238](https://github.com/dungpa/fantomas/issues/238)
* Formatting of code with a pipe and a lambda expression [#211](https://github.com/dungpa/fantomas/issues/211)

#### 2.7.1 - 03-05-2018
* Hotfix for runtime problem when using dotnet cli tool

Expand Down
8 changes: 4 additions & 4 deletions src/Fantomas.Cmd/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("Fantomas")>]
[<assembly: AssemblyProductAttribute("Fantomas")>]
[<assembly: AssemblyDescriptionAttribute("Source code formatter for F#")>]
[<assembly: AssemblyVersionAttribute("2.7.1")>]
[<assembly: AssemblyFileVersionAttribute("2.7.1")>]
[<assembly: AssemblyVersionAttribute("2.7.2")>]
[<assembly: AssemblyFileVersionAttribute("2.7.2")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "Fantomas"
let [<Literal>] AssemblyProduct = "Fantomas"
let [<Literal>] AssemblyDescription = "Source code formatter for F#"
let [<Literal>] AssemblyVersion = "2.7.1"
let [<Literal>] AssemblyFileVersion = "2.7.1"
let [<Literal>] AssemblyVersion = "2.7.2"
let [<Literal>] AssemblyFileVersion = "2.7.2"
2 changes: 1 addition & 1 deletion src/Fantomas.Cmd/Fantomas.Cmd.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0;net45</TargetFrameworks>
<Version>2.7.1</Version>
<Version>2.7.2</Version>
<AssemblyName>dotnet-fantomas</AssemblyName>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Fantomas.Tests/Fantomas.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net45</TargetFrameworks>
<Version>2.7.1</Version>
<Version>2.7.2</Version>
<NoWarn>FS0988</NoWarn>
</PropertyGroup>
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Fantomas/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ open System.Runtime.CompilerServices
[<assembly: AssemblyTitleAttribute("FantomasLib")>]
[<assembly: AssemblyProductAttribute("Fantomas")>]
[<assembly: AssemblyDescriptionAttribute("Source code formatter for F#")>]
[<assembly: AssemblyVersionAttribute("2.7.1")>]
[<assembly: AssemblyFileVersionAttribute("2.7.1")>]
[<assembly: AssemblyVersionAttribute("2.7.2")>]
[<assembly: AssemblyFileVersionAttribute("2.7.2")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] InternalsVisibleTo = "Fantomas.Tests"
let [<Literal>] AssemblyTitle = "FantomasLib"
let [<Literal>] AssemblyProduct = "Fantomas"
let [<Literal>] AssemblyDescription = "Source code formatter for F#"
let [<Literal>] AssemblyVersion = "2.7.1"
let [<Literal>] AssemblyFileVersion = "2.7.1"
let [<Literal>] AssemblyVersion = "2.7.2"
let [<Literal>] AssemblyFileVersion = "2.7.2"
2 changes: 1 addition & 1 deletion src/Fantomas/Fantomas.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<Version>2.7.1</Version>
<Version>2.7.2</Version>
</PropertyGroup>
<ItemGroup>
<None Include="paket.references" />
Expand Down
17 changes: 10 additions & 7 deletions src/Fantomas/SourceTransformer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,17 @@ let rec multiline synExpr =
// Default mode is single-line
| _ -> false

let checkNewLine e es =
let checkNewLine e es =
match (e, es) with
| (Microsoft.FSharp.Compiler.Ast.SynExpr.Match(_,_,_,_,_), (s, e1) :: _) ->
true
| (_, (s, e1) :: _) ->
let containsInfix = NewLineInfixOps.Contains s
let isMultiline = multiline e1
containsInfix
| _, [s, infixExpr] when NewLineInfixOps.Contains s ->
(*
If s is a single infix (f.e. |> )
Only multiline if the whole expression is multiline
or the next expression is multiline
See test ``pipe and multiline should put pipe on newline``
*)
multiline e || multiline infixExpr
| _, (s, _) :: _ :: _ -> NewLineInfixOps.Contains s
| _ -> multiline e

/// Check if the expression already has surrounding parentheses
Expand Down

0 comments on commit 890c5a1

Please sign in to comment.