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

Format fsharp code #3609

Merged
merged 10 commits into from
Nov 24, 2023
Merged

Format fsharp code #3609

merged 10 commits into from
Nov 24, 2023

Conversation

nojaf
Copy link
Member

@nojaf nojaf commented Nov 23, 2023

See #3596

When it comes to git hooks, you could add this one. However, a git hook is typically something personal which you don't put in source control (as it lives in the .git folder).

I've added the commands the F# team is using to format their code by commenting /run fantomas on the PR.

@nojaf nojaf marked this pull request as ready for review November 23, 2023 09:46
@dbrattli
Copy link
Collaborator

Very nice. Agree about git hooks. We could add that as developer documentation so those who wants can add themselves to avoid too many "fix formatting" commits.

@MangelMaxime
Copy link
Member

For the git hooks, we could use Husky.Net.

This is a tool which allows you to commit the hooks information and then you can use dotnet husky attach to automate the installation.

We can run dotnet husky attach at the top of the build process:

[<EntryPoint>]
let main argv =
    let argv = argv |> Array.map (fun x -> x.ToLower()) |> Array.toList

	// Run dotnet husky attach here

    match argv with
    | "fable-library" :: args ->

What do you think?

@nojaf
Copy link
Member Author

nojaf commented Nov 24, 2023

Interesting idea, I never heard of Husky.
Would be nice to play around with.
If the experience is positive, we might even recommend it in the Fantomas docs.

@MangelMaxime
Copy link
Member

Thank you @nojaf

@MangelMaxime MangelMaxime merged commit f030cd3 into fable-compiler:main Nov 24, 2023
15 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