Merge pull request #65 from srid/rm-hlintCheck

Remove `hlintCheck` in favour of treefmt-nix
This commit is contained in:
Sridhar Ratnakumar 2023-02-06 17:53:33 -05:00 committed by GitHub
commit 7c4af21238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 41 deletions

View File

@ -6,6 +6,7 @@
- #63: Add `config.haskellProjects.${name}.outputs` containing all flake outputs for that project.
- API changes
- #37: Group `buildTools` (renamed to `tools`), `hlsCheck` and `hlintCheck` under the `devShell` submodule option; and allow disabling them all using `devShell.enable = false;` (useful if you want haskell-flake to produce just the package outputs).
- #64: Remove hlintCheck (use [treefmt-nix](https://github.com/numtide/treefmt-nix#flake-parts) instead)
## 0.1.0

View File

@ -33,3 +33,7 @@ Check out the [list of options](https://flake.parts/options/haskell-flake.html).
- Complex:
- https://github.com/srid/emanote/blob/master/flake.nix
- https://github.com/srid/ema/blob/master/flake.nix
## Recommendations
- Use [`treefmt-nix`](https://github.com/numtide/treefmt-nix#flake-parts) for providing linting features like auto-formatting and hlint checks. See [haskell-template](https://github.com/srid/haskell-template) for example.

View File

@ -18,7 +18,6 @@
# devShell = {
# enable = true; # Enabled by default
# tools = hp: { fourmolu = hp.fourmolu; ghcid = null; };
# hlintCheck.enable = true;
# hlsCheck.enable = true;
# };
};

View File

@ -35,20 +35,6 @@ in
};
};
hlintCheckSubmodule = types.submodule {
options = {
enable = mkOption {
type = types.bool;
description = "Whether to add a flake check to run hlint";
default = false;
};
dirs = mkOption {
type = types.listOf types.str;
description = "Relative path strings from `root` to directories that should be checked with hlint";
default = [ "." ];
};
};
};
packageSubmodule = with types; submodule {
options = {
root = mkOption {
@ -83,13 +69,6 @@ in
A [check](flake-parts.html#opt-perSystem.checks) to make sure that your IDE will work.
'';
};
hlintCheck = mkOption {
default = { };
type = hlintCheckSubmodule;
description = ''
A [check](flake-parts.html#opt-perSystem.checks) that runs [`hlint`](https://github.com/ndmitchell/hlint).
'';
};
};
};
projectSubmodule = types.submodule (args@{ name, config, lib, ... }: {

View File

@ -95,23 +95,12 @@ in
devShells."${projectKey}" = devShell;
checks = lib.filterAttrs (_: v: v != null) {
"${projectKey}-hls" =
if config.devShell.hlsCheck.enable then
runCommandInSimulatedShell
devShell
self "${projectKey}-hls-check"
{ } "haskell-language-server"
else null;
"${projectKey}-hlint" =
if config.devShell.hlintCheck.enable then
runCommandInSimulatedShell
devShell
self "${projectKey}-hlint-check"
{ } ''
hlint ${lib.concatStringsSep " " config.devShell.hlintCheck.dirs}
''
else null;
};
} // lib.optionalAttrs config.devShell.hlsCheck.enable {
checks."${projectKey}-hls" =
runCommandInSimulatedShell
devShell
self "${projectKey}-hls-check"
{ } "haskell-language-server";
};
}

View File

@ -40,7 +40,6 @@
# You can also add additional build tools.
fzf = pkgs.fzf;
};
hlintCheck.enable = true;
hlsCheck.enable = true;
};
};