| name | haskell-cabal-gild |
| description | Format Haskell package descriptions and cabal project files with cabal-gild: *.cabal, cabal.project, cabal.project.local, and cabal.project.freeze. Use after editing dependencies or stanzas, when refreshing cabal-gild discover module lists, or when checking cabal file formatting.
|
cabal-gild
cabal-gild formats Haskell package descriptions and cabal project files. It normalizes layout, sorts and deduplicates build-depends, and can refresh module lists generated by -- cabal-gild: discover pragmas.
Format In Place
Run on each touched cabal/project file:
cabal-gild --io <file>
Format before compiling.
Check Without Writing
Use check mode to verify formatting without changing files:
cabal-gild -m check --io <file>
Auto-Discovered Module Lists
If a .cabal file contains a pragma like this:
-- cabal-gild: discover src
exposed-modules:
rerun cabal-gild --io <pkg>.cabal after adding or removing modules.
Project Automation
This repository has shared PostToolUse hooks under .agents/hooks/, wired from
Claude/Codex configuration.
- A changed
.cabal or cabal.project* file is formatted with cabal-gild --io.
- A changed
.hs, .lhs, or .hsig file refreshes the nearest enclosing .cabal file only if it uses a -- cabal-gild: discover pragma.
Re-read files if the hook reports that it changed them.
Companion
Format Haskell source files with the haskell-format skill.