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

Ensure formatted Nix and Haskell files #185

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Ensure formatted Nix and Haskell files #185

merged 3 commits into from
Apr 18, 2024

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Apr 4, 2024

Ensures that all Nix files are formatted with pkgs.nixfmt-rfc-style (not the local version to avoid having to build the package for the dev environment!) and Haskell files are formatted with fourmolu with some reasonable configuration.

@infinisil infinisil requested review from piegamesde and a team April 4, 2024 21:15
Base automatically changed from hlint to master April 15, 2024 15:23
@infinisil infinisil marked this pull request as ready for review April 15, 2024 15:28
Copy link

github-actions bot commented Apr 15, 2024

Nixpkgs diff

1 similar comment
Copy link

Nixpkgs diff

@infinisil
Copy link
Member Author

We looked at this in the team meeting:

  • let in and imports look weird, let's switch to fourmolu, which can be customized
  • Customizations:
    • in-style: no-space
    • import-export-style: diff-friendly
  • @infinisil will update the PR afterwards
  • Point out that treefmt can be run in the readme (future: pre-commit hook)

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/formatting-team-meeting-2024-04-16/43533/1

@infinisil infinisil force-pushed the treefmt branch 2 times, most recently from 9610b51 to d8dff38 Compare April 17, 2024 20:59
@infinisil
Copy link
Member Author

@piegamesde Now using fourmolu, please merge if it looks good :)

@piegamesde
Copy link
Member

treefmt fails

Haskell has various formatters and no standard one.
While I originally wanted to use ormolu, we agreed to switch to fourmolu
because we weren't super happy about some decisions in ormolu.
@infinisil infinisil enabled auto-merge April 18, 2024 22:12
@infinisil infinisil merged commit a8b578d into master Apr 18, 2024
2 checks passed
@infinisil infinisil deleted the treefmt branch April 18, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants