4d5bd514

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Skip a build directory by its whole name, not by a prefix of it

The discovery walk skipped any directory whose name started with "result",
meaning to skip a nix build output. It also skipped one called "results", and
every package under it went missing from discovery with nothing reported: a
walk that finds no cabal file and a walk that refused to look are the same
answer to a caller.

What is left is dist-newstyle and anything hidden, compared as whole names.
None of it matters inside a Nix build, where the source is a store path copied
from the git tree and an ignored directory never arrives. It is for a working
tree, and there dist-newstyle earns it: cabal unpacks a
source-repository-package into dist-newstyle/src, cabal file and all. sydtest
has one, and walking into it reports thirteen findings against a file nobody
there wrote. A hidden directory is the same story, .stack-work most of all.

Two names are gone rather than corrected. result is a symlink to a build output
that holds no cabal file, and refusing to follow a symlink would lose a package
a repository links in on purpose, which is the same silent loss in a different
guise. Nothing puts a Haskell package under node_modules, so naming it only
added something to be wrong about.

The predicate is top-level and exported, where the walk had it in a where clause
with no signature and no test. It is pure, so the prefix case is a unit test
rather than a walk over a fixture, and there is a fixture too: a package two
levels under a directory called results, which is what was being dropped.

The fixture needed a line in .gitignore. The global ignore file has result*,
which hides a directory called results the same way this walk did.
hlint-checkpre-commitreleaseshellweeder-checkconfiguredevShelldefaultx86_64-linux