Skip to content

Ask ghc/cabal for --ghc-opts #517

@fisx

Description

@fisx

We are currently doing this:

LANGUAGE_EXTS=$(perl -ne '$x=1 if /default-extensions:/?1:(/^[^-]/?0:$x); print "--ghc-opt -X$1 " if ($x && /^- (.+)/);' package-defaults.yaml)
[...]
    ormolu [...] $LANGUAGE_EXTS [...]

... and various other hacks in our editor bindings.

I have very little insight into how feasible this would be, but it would be nice to have ormolu look at cabal file, package.yaml and all its imports, language extensions and options declared in the input file etc., and just always do the right thing.

I would be interested in any hints on how to do this, and any informed opinions on how hard it'd be. Still haven't decided what to do on https://zurihac.info this year. :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions