-
Notifications
You must be signed in to change notification settings - Fork 266
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
Moar fantomas #614
Moar fantomas #614
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*.{fs,fsi,fsx}] | ||
end_of_line = lf | ||
fsharp_multiline_bracket_style = aligned | ||
fsharp_multi_line_lambda_closing_newline = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bit of a personal preference. |
||
|
||
[{tests,samples}/**/*.fs] | ||
fsharp_experimental_elmish = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Formats expressions like |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
* text=auto | ||
*.sh text eol=lf | ||
*.sh text eol=lf | ||
|
||
# Always use lf for F# files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Life is easier when all files are |
||
*.fs text eol=lf | ||
*.fsx text eol=lf | ||
*.fsi text eol=lf |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,25 +235,10 @@ Please be aware that Giraffe strictly aims to remain as light as possible while | |
|
||
### Code conventions | ||
|
||
When making changes please use existing code as a guideline for coding style and documentation. For example add spaces when creating tuples (`(a,b)` --> `(a, b)`), annotating variable types (`str:string` --> `str : string`) or other language constructs. | ||
We use [Fantomas](https://fsprojects.github.io/fantomas/docs/index.html) to ensure consistent code formatting across the project. Before committing, format your code by running the following command: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not do any attempt to keep the rules. They were implemented inconsistent anyway and I feel like the default from the style guide suffice here. |
||
|
||
Examples: | ||
|
||
```fsharp | ||
let someHttpHandler:HttpHandler = | ||
fun (ctx:HttpContext) next -> task { | ||
// Some work | ||
} | ||
``` | ||
|
||
should be: | ||
|
||
```fsharp | ||
let someHttpHandler : HttpHandler = | ||
fun (ctx : HttpContext) (next : HttpFunc) -> | ||
task { | ||
// Some work | ||
} | ||
```bash | ||
dotnet fantomas src samples tests | ||
``` | ||
|
||
### Keep documentation and unit tests up to date | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easier for source controle diff.