Skip to content

Style guide

Artem Pelenitsyn edited this page Sep 23, 2023 · 2 revisions

Fourmolu (Summer 2023)

As of Summer 2023, the codebase is formatted with Fourmolu. See details here: https://github.com/haskell/cabal/blob/b639bfaf5d825b2954f89d00c93e40ff79bc3475/CONTRIBUTING.md#code-style

History

Text below is no longer relevant but preserved for historical interest. Some links are unfortunately gone.

Being the product of many years' work by many authors, Cabal code (as of the date of writing, April 2013) is written in several conflicting styles.

There has been some recent discussion about whether or not to adopt an official style guide. A consensus has not yet been reached, but here are some resources to help shape it:

  • Johan Tibell has a style guide that he uses for his own projects, and is quite widely recognised, but some authors have objections to specific parts of it.
  • stylish-haskell is a tool for making code, particularly import lists, prettier.