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

Fix 143 #259

Merged
merged 6 commits into from
Jun 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Fantomas.Cmd/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ let [<Literal>] stdOutText = " Write the formatted source code to standard outpu
let [<Literal>] indentText = "Set number of spaces for indentation (default = 4). The value should be between 1 and 10."
let [<Literal>] widthText = "Set the column where we break to new lines (default = 80). The value should be at least 60."

let [<Literal>] preserveEOLText = "Preserve original end of lines, disables auto insert/remove of blank lines (default = false)"
let [<Literal>] semicolonEOLText = "Enable semicolons at the end of line (default = false)."
let [<Literal>] argumentText = "Disable spaces before the first argument of functions when there are parenthesis (default = true). For methods and constructors, there are never spaces regardless of this option."
let [<Literal>] colonText = "Disable spaces before colons (default = true)."
Expand Down Expand Up @@ -108,6 +109,7 @@ let main _args =
let indent = ref 4
let pageWidth = ref 80

let preserveEOL = ref false
let semicolonEOL = ref false
let spaceBeforeArgument = ref true
let spaceBeforeColon = ref true
Expand Down Expand Up @@ -225,6 +227,7 @@ let main _args =
ArgInfo("--indent", ArgType.Int handleIndent, indentText);
ArgInfo("--pageWidth", ArgType.Int handlePageWidth, widthText);

ArgInfo("--preserveEOL", ArgType.Set preserveEOL, preserveEOLText)
ArgInfo("--semicolonEOL", ArgType.Set semicolonEOL, semicolonEOLText);
ArgInfo("--noSpaceBeforeArgument", ArgType.Clear spaceBeforeArgument, argumentText);
ArgInfo("--noSpaceBeforeColon", ArgType.Clear spaceBeforeColon, colonText);
Expand All @@ -242,6 +245,7 @@ let main _args =
{ FormatConfig.Default with
IndentSpaceNum = !indent;
PageWidth = !pageWidth;
PreserveEndOfLine = !preserveEOL;
SemicolonAtEndOfLine = !semicolonEOL;
SpaceBeforeArgument = !spaceBeforeArgument;
SpaceBeforeColon = !spaceBeforeColon;
Expand Down
1 change: 1 addition & 0 deletions src/Fantomas.Tests/Fantomas.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<Compile Include="VerboseSyntaxConversionTests.fs" />
<Compile Include="FormattingSelectionTests.fs" />
<Compile Include="FormattingSelectionOnlyTests.fs" />
<Compile Include="PreserveEOLTests.fs" />
<Compile Include="ValidationTests.fs" />
<Compile Include="FormattingPropertyTests.fs" />
<Compile Include="SpecialConstructsTests.fs" />
Expand Down
Loading