Skip to content

Commit

Permalink
Remove haddock-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
tbidne committed Sep 16, 2023
1 parent 03b01dc commit 0093360
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 139 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
cmd: "nix run .#fourmolu -- --help"
- name: "hlint"
cmd: "nix run .#hlint -- --help"
- name: "haddock coverage"
cmd: "nix run .#haddock-cov -- --nh-help"
- name: "nixpkgs-fmt"
cmd: "nix run .#nixpkgs-fmt"
- name: "ormolu"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to the
[Haskell Package Versioning Policy](https://pvp.haskell.org/).

## [0.9] -- 2023-09-16
### Remove
* Removed `haddock-cov`
### Changed
* Updated tools:
* `cabal-fmt: 0.1.6 -> 0.1.7`
Expand Down
32 changes: 0 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,38 +185,6 @@ nix run github:tbidne/nix-hs-tools#hlint -- --refact --refactor-options=""

## Haskell Miscellaneous

### Haddock Coverage

**Source:** https://haskell-haddock.readthedocs.io/en/latest/

**Version:** 0.1.1

**Description:** Tool for checking haddock coverage. Unlike the other tools that provide all dependencies, this tool requires `cabal` and `ghc` to be on the `$PATH` and the project to build with `cabal haddock`. In particular, if nix is used to provide dependencies, this command should be run inside the same nix shell.

**Usage:**

```
haddock-cov [-t|--threshold PERCENTAGE] [-x|--exclude MODULE]
[-m|--module-threshold MODULE PERCENTAGE]
[-v|--version] <args>
```

**Examples:**

```
# checks that all modules in the default package have 100% haddock coverage
nix run github:tbidne/nix-hs-tools#haddock-cov
# checks that all modules in the default package have 70% haddock coverage
nix run github:tbidne/nix-hs-tools#haddock-cov -- --threshold 70
# checks haddock coverage in all packages, excluding Data.Foo and Bar modules.
nix run github:tbidne/nix-hs-tools#haddock-cov -- --exclude Data.Foo -x Bar --haddock-all
# drops coverage for Data.Foo and Bar to 70 and 65, respectively.
nix run github:tbidne/nix-hs-tools#haddock-cov -- --module-threshold Data.Foo 70 -m Bar 65
```

### HIE

**Source:** https://github.com/Avi-D-coder/implicit-hie
Expand Down
6 changes: 1 addition & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
desc = ''
Nix-hs-tools uses nix to provide tools for haskell development.
In general, we take some 3rd party tool (e.g. ormolu) and provide it with nix,
along with some extra functionality "on top" for convenience.\n
along with some extra functionality 'on top' for convenience.\n
To see a tool's individual usage, pass the '--nh-help' arg e.g.
\t$ nix run github:tbidne/nix-hs-tools#ormolu -- --nh-help
Expand All @@ -50,7 +50,6 @@
\tHaskell Linters:
\t - hlint: ${compiler.hlint.version}
\tHaskell Miscellaneous:
\t - haddock-cov: ${haddock-cov.version}
\t - hie: ${compiler.implicit-hie.version}
\tNix Formatters:
\t - nixpkgs-fmt: ${pkgs.nixpkgs-fmt.version}
Expand All @@ -60,8 +59,6 @@
See github.com/tbidne/nix-hs-tools#readme.
'';
version = "0.9";

haddock-cov = import ./tools/haddock-cov.nix { inherit nix-hs-utils pkgs; };
in
{
apps = {
Expand All @@ -82,7 +79,6 @@

hie = import ./tools/hie.nix compilerPkgs;
hlint = import ./tools/hlint.nix compilerPkgs;
haddock-cov = haddock-cov.app;
nixpkgs-fmt = import ./tools/nixpkgs-fmt.nix { inherit nix-hs-utils pkgs; };
ormolu = import ./tools/ormolu.nix compilerPkgs;
stylish = import ./tools/stylish.nix compilerPkgs;
Expand Down
2 changes: 1 addition & 1 deletion tools/cabal-fmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ nix-hs-utils.mkShellApp {
${compiler.cabal-fmt}/bin/cabal-fmt "''${args[@]}" $(${pkgs.fd}/bin/fd "$dir" -e cabal)
'';
runtimeInputs = [ compiler.cabal-fmt pkgs.fd ];
}
}
97 changes: 0 additions & 97 deletions tools/haddock-cov.nix

This file was deleted.

6 changes: 4 additions & 2 deletions tools/hlint.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ nix-hs-utils.mkShellApp {
elif [[ $1 == "--refact" ]]; then
refact=1
else
args+=($1)
args+=("$1")
fi
shift
done
if [[ $refact == 0 ]]; then
${compiler.hlint}/bin/hlint --ignore-glob=dist-newstyle --ignore-glob=stack-work ''${args[@]} $(${pkgs.fd}/bin/fd "$dir" -e hs)
# shellcheck disable=SC2046
${compiler.hlint}/bin/hlint --ignore-glob=dist-newstyle --ignore-glob=stack-work "''${args[@]}" $(${pkgs.fd}/bin/fd "$dir" -e hs)
else
# refactor works on individual files only
# shellcheck disable=SC2145
${pkgs.fd}/bin/fd "$dir" -e hs | ${pkgs.findutils}/bin/xargs -I % sh -c "
${compiler.hlint}/bin/hlint \
--ignore-glob=dist-newstyle \
Expand Down

0 comments on commit 0093360

Please sign in to comment.