graphql-engine/weeder.dhall
Tom Harding a3031aed03 Add Weeder, begin weeding (1/?)
## Description

This PR adds a config file for [`weeder`](https://github.com/ocharles/weeder) to the `-mono` repository. `weeder` checks for dead code by building a call graph from the given entry points (currently every module named `Main` with a `main` function) and then marking every function _not_ in that call graph as dead code.

To avoid very large PRs, I'm going to tackle this in a series. This first PR adds the basic configuration, plus removes as many weeds as it took for me to realise this was going to become a very big PR. The PRs after this will largely be removing dead code, until the final PR that will add Weeder to the CI pipeline.

### Related Issues

This closes #2973.

## Affected components

- Server

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4572
GitOrigin-RevId: ac8eaa9473e5ac1f16babcb35388694392d0d7dc
2022-05-31 15:43:34 +00:00

27 lines
1.0 KiB
Plaintext

{ roots =
[ -- All the executables (including tests) have an entrypoint called
-- `Main.main`, which means that Weeder will run for any package that has
-- been built (_as long as_ it is built with `-fwrite-ide-info`).
"^Main.main$"
-- Modules generated by Cabal. These are, according to Weeder repository
-- tips, safe to ignore: https://github.com/ocharles/weeder/#tips
, "^Paths_.*"
-- "Library" modules that may one day be released as standalone OSS
-- things. While these functions may not all be used, they're still worth
-- keeping around until this module is extracted from the monorepo.
, "^Control.Arrow.Extended.*"
, "^Data.HashMap.Strict.NonEmpty.*"
-- Debugging functions. They are not entry points, but if we include them
-- as such, Weeder won't try to get rid of the definitions.
--
-- https://github.com/ocharles/weeder/pull/58
, "^Hasura.Prelude.ltrace$"
, "^Hasura.Prelude.ltraceM$"
]
, type-class-roots = True
}