Skip to content

Document cabal-fmt comment pragmas #35

@elldritch

Description

@elldritch

It would be great if these were documented in README.md or in --help.

What are all the pragmas? The only one I'm aware of is cabal-fmt: expand DIR [EXCLUDE...] where each EXCLUDE is formatted as -Module e.g. cabal-fmt expand: app -Main.

However, looking through the source code seems to indicate that there are more pragmas:

"expand" -> expandModules
"indent" -> indent
"glob-files" -> globFiles
"tabular" -> return $ GlobalPragma $ PragmaOptTabular True
"no-tabular" -> return $ GlobalPragma $ PragmaOptTabular False
"fragment" -> fragment
_ -> fail $ "Unknown pragma " ++ t

GitHub search seems to show more pragmas as well (at least a cabal-fmt: fragment and cabal-fmt: glob-files): https://github.com/search?q=%22cabal-fmt%3A+%22+extension%3Acabal&type=Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions