Skip to content

nix(hlint): apply hlint's suggestions inplace - #5195

Merged
wolfgangwalther merged 1 commit into
PostgREST:mainfrom
taimoorzaeem:hlint/inplace-fix
Sep 3, 2026
Merged

nix(hlint): apply hlint's suggestions inplace#5195
wolfgangwalther merged 1 commit into
PostgREST:mainfrom
taimoorzaeem:hlint/inplace-fix

Conversation

@taimoorzaeem

@taimoorzaeem taimoorzaeem commented Aug 26, 2026

Copy link
Copy Markdown
Member

postgrest-lint now applies hlint's suggestions inplace to all
haskell files.

Hlint supports this via another package apply-refact which is marked broken in nixpkgs because it doesn't build with GHC 9.10, so we are using the GHC 9.12 pinned version.

@taimoorzaeem
taimoorzaeem marked this pull request as draft August 26, 2026 15:33
@taimoorzaeem
taimoorzaeem force-pushed the hlint/inplace-fix branch 2 times, most recently from 6379347 to 473f3ca Compare August 27, 2026 10:38
@taimoorzaeem taimoorzaeem changed the title nix(lint): add option to apply inplace hlint suggestions nix(hlint): add option to apply inplace hlint suggestions Aug 27, 2026
@taimoorzaeem
taimoorzaeem marked this pull request as ready for review August 27, 2026 10:38
@taimoorzaeem taimoorzaeem added the nix related to Nix tooling label Aug 27, 2026
@steve-chavez

steve-chavez commented Aug 27, 2026

Copy link
Copy Markdown
Member

postgrest-lint now supports an optional argument --apply-hlint-suggestions which applies Hlint suggestions inplace to the input haskell file.

Very useful, I'd prefer this be the default behavior and the flag turns it off. If the lint is not applied we fail on CI anyway.

No flag is also an option.

@wolfgangwalther

Copy link
Copy Markdown
Member

No flag is also an option.

👍

@taimoorzaeem taimoorzaeem changed the title nix(hlint): add option to apply inplace hlint suggestions nix(hlint): apply hlint's suggestions inplace Aug 28, 2026
@taimoorzaeem
taimoorzaeem marked this pull request as draft August 28, 2026 13:46
@taimoorzaeem

Copy link
Copy Markdown
Member Author

No flag is also an option.

If we doing this as default, then we should also introduce the postgrest-lint-check the same way we have postgrest-style-check for postgrest-style.

@wolfgangwalther

Copy link
Copy Markdown
Member

If we doing this as default, then we should also introduce the postgrest-lint-check the same way we have postgrest-style-check for postgrest-style.

At this point we should just introduce better tooling to handle these formatters and linters entirely. treefmt is good, with great nix integration. Will look into adding that instead to unify the interface.

@wolfgangwalther

Copy link
Copy Markdown
Member

At this point we should just introduce better tooling to handle these formatters and linters entirely. treefmt is good, with great nix integration. Will look into adding that instead to unify the interface.

See #5200 for that.

@wolfgangwalther

Copy link
Copy Markdown
Member

Rebased over the addition of treefmt and extended the commentary a bit.

`postgrest-lint` now applies hlint's suggestions inplace to all
haskell files.

Hlint supports this via another package `apply-refact` which is
marked broken in nixpkgs because it doesn't build with GHC 9.10,
so we are using the GHC 9.12 pinned version.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
@taimoorzaeem

Copy link
Copy Markdown
Member Author

Rebased over the addition of treefmt and extended the commentary a bit.

Looks great! 👍

@taimoorzaeem
taimoorzaeem marked this pull request as ready for review September 3, 2026 10:46
@wolfgangwalther
wolfgangwalther merged commit 64869d0 into PostgREST:main Sep 3, 2026
29 checks passed
@postgrest-ci

postgrest-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

Successfully created backport PR for v16:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport v16 nix related to Nix tooling

Development

Successfully merging this pull request may close these issues.

3 participants