-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from tboby/apply-formatting
Add formatting and Warnings as Errors
- Loading branch information
Showing
10 changed files
with
126 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
[*.{fs,fsi,fsx}] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{fs,fsx,fsi}] | ||
max_line_length = 100 | ||
fsharp_alternative_long_member_definitions = true | ||
fsharp_multi_line_lambda_closing_newline = true | ||
fsharp_multiline_bracket_style = aligned | ||
fsharp_keep_max_number_of_blank_lines = 1 | ||
fsharp_align_function_signature_to_indentation = true | ||
fsharp_max_if_then_else_short_width = 0 | ||
fsharp_experimental_keep_indent_in_branch = true | ||
fsharp_bar_before_discriminated_union_declaration = true | ||
|
||
fsharp_experimental_elmish = true | ||
fsharp_record_multiline_formatter = number_of_items | ||
fsharp_array_or_list_multiline_formatter = number_of_items | ||
fsharp_max_record_number_of_items = 0 | ||
fsharp_max_array_or_list_number_of_items = 0 | ||
# Expecto looks a bit nicer with stroustrup | ||
[tests/**/*.fs] | ||
fsharp_multiline_bracket_style = stroustrup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Automatically normalize line endings | ||
* text=auto | ||
|
||
# Always use lf for F# files | ||
*.fs text eol=lf | ||
*.fsx text eol=lf | ||
*.fsi text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module Ionide.KeepAChangelog.Tasks.Test.Helpers | ||
|
||
open System.Runtime.CompilerServices | ||
open Faqt | ||
open Faqt.AssertionHelpers | ||
|
||
[<Extension>] | ||
type Assertions = | ||
|
||
/// Asserts that the subject is equal to the specified string when CLRF is replaced with LF in both raw and | ||
/// escaped forms. | ||
[<Extension>] | ||
static member BeLineEndingEquivalent(t: Testable<string>, expected: string, ?because) : And<string> = | ||
use _ = t.Assert() | ||
|
||
if isNull expected then | ||
nullArg (nameof expected) | ||
|
||
if isNull t.Subject then | ||
t.With("Expected", expected).With("But was", t.Subject).Fail(because) | ||
|
||
let expectedNormalised = expected.Replace("\r\n", "\n").Replace("\\r\\n", "\\n") | ||
|
||
let subjectNormalised = t.Subject.Replace("\r\n", "\n").Replace("\\r\\n", "\\n") | ||
|
||
if subjectNormalised <> expectedNormalised then | ||
t | ||
.With("Expected", expectedNormalised) | ||
.With("But was", subjectNormalised) | ||
.Fail(because) | ||
|
||
And(t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.