fourmolu-0.4.0.0: A formatter for Haskell source code
Safe HaskellNone
LanguageHaskell2010

Ormolu.Config

Description

Configuration options used by the tool.

Synopsis

Documentation

data Config region Source #

Ormolu configuration.

Constructors

Config 

Fields

Instances

Instances details
Functor Config Source # 
Instance details

Defined in Ormolu.Config

Methods

fmap :: (a -> b) -> Config a -> Config b #

(<$) :: a -> Config b -> Config a #

Eq region => Eq (Config region) Source # 
Instance details

Defined in Ormolu.Config

Methods

(==) :: Config region -> Config region -> Bool #

(/=) :: Config region -> Config region -> Bool #

Show region => Show (Config region) Source # 
Instance details

Defined in Ormolu.Config

Methods

showsPrec :: Int -> Config region -> ShowS #

show :: Config region -> String #

showList :: [Config region] -> ShowS #

data ColorMode Source #

Whether to use colors and other features of ANSI terminals.

Constructors

Never 
Always 
Auto 

data RegionIndices Source #

Region selection as the combination of start and end line numbers.

Constructors

RegionIndices 

Fields

Instances

Instances details
Eq RegionIndices Source # 
Instance details

Defined in Ormolu.Config

Show RegionIndices Source # 
Instance details

Defined in Ormolu.Config

data RegionDeltas Source #

Region selection as the length of the literal prefix and the literal suffix.

Constructors

RegionDeltas 

Fields

Instances

Instances details
Eq RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

Show RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

data PrinterOpts f Source #

Options controlling formatting output.

Constructors

PrinterOpts 

Fields

Instances

Instances details
Eq PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Semigroup PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Monoid PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

FromJSON PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Generic (PrinterOpts f) Source # 
Instance details

Defined in Ormolu.Config

Associated Types

type Rep (PrinterOpts f) :: Type -> Type #

Methods

from :: PrinterOpts f -> Rep (PrinterOpts f) x #

to :: Rep (PrinterOpts f) x -> PrinterOpts f #

type Rep (PrinterOpts f) Source # 
Instance details

Defined in Ormolu.Config

type Rep (PrinterOpts f) = D1 ('MetaData "PrinterOpts" "Ormolu.Config" "fourmolu-0.4.0.0-LeiclRjONUdFWKAZR6QEVU" 'False) (C1 ('MetaCons "PrinterOpts" 'PrefixI 'True) (((S1 ('MetaSel ('Just "poIndentation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Int)) :*: S1 ('MetaSel ('Just "poCommaStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f CommaStyle))) :*: (S1 ('MetaSel ('Just "poIndentWheres") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)) :*: S1 ('MetaSel ('Just "poRecordBraceSpace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)))) :*: ((S1 ('MetaSel ('Just "poDiffFriendlyImportExport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool)) :*: S1 ('MetaSel ('Just "poRespectful") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Bool))) :*: (S1 ('MetaSel ('Just "poHaddockStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f HaddockPrintStyle)) :*: S1 ('MetaSel ('Just "poNewlinesBetweenDecls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f Int))))))

type PrinterOptsPartial = PrinterOpts Maybe Source #

A version of PrinterOpts where any field can be empty. This corresponds to the information in a config file or in CLI options.

type PrinterOptsTotal = PrinterOpts Identity Source #

A version of PrinterOpts without empty fields.

loadConfigFile :: FilePath -> IO ConfigFileLoadResult Source #

Read options from a config file, if found. Looks recursively in parent folders, then in XdgConfig, for a file named fourmolu.yaml.

configFileName :: FilePath Source #

Expected file name for YAML config.

fillMissingPrinterOpts :: forall f. Applicative f => PrinterOptsPartial -> PrinterOpts f -> PrinterOpts f Source #

Fill the field values that are Nothing in the first argument with the values of the corresponding fields of the second argument.

data CommaStyle Source #

Constructors

Leading 
Trailing 

Instances

Instances details
Bounded CommaStyle Source # 
Instance details

Defined in Ormolu.Config

Enum CommaStyle Source # 
Instance details

Defined in Ormolu.Config

Eq CommaStyle Source # 
Instance details

Defined in Ormolu.Config

Ord CommaStyle Source # 
Instance details

Defined in Ormolu.Config

Show CommaStyle Source # 
Instance details

Defined in Ormolu.Config

Generic CommaStyle Source # 
Instance details

Defined in Ormolu.Config

Associated Types

type Rep CommaStyle :: Type -> Type #

FromJSON CommaStyle Source # 
Instance details

Defined in Ormolu.Config

type Rep CommaStyle Source # 
Instance details

Defined in Ormolu.Config

type Rep CommaStyle = D1 ('MetaData "CommaStyle" "Ormolu.Config" "fourmolu-0.4.0.0-LeiclRjONUdFWKAZR6QEVU" 'False) (C1 ('MetaCons "Leading" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Trailing" 'PrefixI 'False) (U1 :: Type -> Type))

data HaddockPrintStyle Source #

Instances

Instances details
Bounded HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

Enum HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

Eq HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

Ord HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

Show HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

Generic HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

Associated Types

type Rep HaddockPrintStyle :: Type -> Type #

FromJSON HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

type Rep HaddockPrintStyle Source # 
Instance details

Defined in Ormolu.Config

type Rep HaddockPrintStyle = D1 ('MetaData "HaddockPrintStyle" "Ormolu.Config" "fourmolu-0.4.0.0-LeiclRjONUdFWKAZR6QEVU" 'False) (C1 ('MetaCons "HaddockSingleLine" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "HaddockMultiLine" 'PrefixI 'False) (U1 :: Type -> Type))

regionIndicesToDeltas Source #

Arguments

:: Int

Total number of lines in the input

-> RegionIndices

Region indices

-> RegionDeltas

Region deltas

newtype DynOption Source #

A wrapper for dynamic options.

Constructors

DynOption 

Fields

Instances

Instances details
Eq DynOption Source # 
Instance details

Defined in Ormolu.Config

Ord DynOption Source # 
Instance details

Defined in Ormolu.Config

Show DynOption Source # 
Instance details

Defined in Ormolu.Config