Skip to content

Commit

Permalink
no haddock-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
tbidne committed Sep 16, 2023
1 parent f87ff79 commit 4300170
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 135 deletions.
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
4 changes: 0 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 4300170

Please sign in to comment.