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

Moar fantomas #614

Merged
merged 4 commits into from
Sep 5, 2024
Merged

Moar fantomas #614

merged 4 commits into from
Sep 5, 2024

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Sep 5, 2024

Description

Format all F# source code.

How to test

CI should check it, otherwise dotnet fantomas src tests samples --check

Related issues

#581

@nojaf nojaf requested a review from 64J0 September 5, 2024 11:56

# Always use lf for F# files
*.fs text eol=lf
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Life is easier when all files are lf.
Your editor most likely uses LF internally anyway (Rider and code do).


[*.{fs,fsi,fsx}]
end_of_line = lf
fsharp_multiline_bracket_style = aligned
Copy link
Contributor Author

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.

[*.{fs,fsi,fsx}]
end_of_line = lf
fsharp_multiline_bracket_style = aligned
fsharp_multi_line_lambda_closing_newline = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit of a personal preference.

fsharp_multi_line_lambda_closing_newline = true

[{tests,samples}/**/*.fs]
fsharp_experimental_elmish = true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formats expressions like foo [ bar1 ; bar2 ] nicer.

@@ -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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

@64J0 64J0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR, it will be awesome to use fantomas for the whole codebase!

@nojaf nojaf merged commit 79910c9 into giraffe-fsharp:master Sep 5, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants