Skip to content

feat(rules): Haskell dist-newstyle and .stack-work - #23

Merged
Finjineersdev merged 1 commit into
mainfrom
rules-haskell
Dec 1, 2026
Merged

Finjineersdev merged 1 commit into
mainfrom
rules-haskell

Conversation

@Finjineersdev

Copy link
Copy Markdown
Owner

What

Adds a rule for Haskell projects (cabal.project, stack.yaml or a *.cabal file in the folder):

Path Class Restore
dist-newstyle Safe cabal build
.stack-work Safe stack build

Sources: each tool's own clean command removes the folder (cabal clean, stack clean --full), and Stack documents .stack-work as the default work directory. Links are in the rule file and the issue.

One point for review: a Git source-repository-package (Cabal) or a Git extra-dep (Stack) is checked out inside these folders, so the next build fetches it again. The build does that by itself with no user step, which is what Safe means in RULE-SCHEMA.md, but say if you would rather have Caution.

Adds haskell.toml to BUNDLED, a Cabal and a Stack match fixture, a nomatch fixture with neither marker, and the README table row.

Closes #22

How tested

  • rule_fixtures_produce_the_expected_candidates covers the new fixtures.
  • Engine checks: fmt ok, clippy ok, cargo test --locked 148 passed, rules-check 13 rule files, 36 artifacts: ok (snapshot updated).

Note: this and the Zig rule PR both add a line to BUNDLED, the README table and the rules-check snapshot, so whichever merges second needs a small rebase.

Cabal builds into dist-newstyle, and `cabal clean` "cleans up the
temporary files and build artifacts stored in the dist-newstyle folder"
(https://cabal.readthedocs.io/en/stable/cabal-commands.html). Stack's
work directory has "Default: .stack-work" and `stack clean --full`
deletes it (https://docs.haskellstack.org/en/stable/configure/yaml/non-project/).
Installed dependencies live in ~/.cabal and ~/.stack, so both folders
are Safe: the next build recreates them.

A project is a folder with cabal.project, stack.yaml or a *.cabal file.
Adds haskell.toml to BUNDLED, a Cabal and a Stack match fixture, a
nomatch fixture with neither, and the README table row. The rules-check
snapshot counts 13 files and 36 artifacts.
@Finjineersdev
Finjineersdev merged commit 62aa696 into main Dec 1, 2026
6 checks passed
@Finjineersdev
Finjineersdev deleted the rules-haskell branch December 1, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Haskell projects: offer Cabal's dist-newstyle and Stack's .stack-work

1 participant