fourmolu-0.19.0.0: A formatter for Haskell source code
Safe HaskellNone
LanguageGHC2021

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 #

Generic (Config region) Source # 
Instance details

Defined in Ormolu.Config

Associated Types

type Rep (Config region) 
Instance details

Defined in Ormolu.Config

type Rep (Config region) = D1 ('MetaData "Config" "Ormolu.Config" "fourmolu-0.19.0.0-2A7Bw6e6QcF3ynYdkj9bKa" 'False) (C1 ('MetaCons "Config" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cfgDynOptions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [DynOption]) :*: (S1 ('MetaSel ('Just "cfgFixityOverrides") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FixityOverrides) :*: S1 ('MetaSel ('Just "cfgModuleReexports") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ModuleReexports))) :*: (S1 ('MetaSel ('Just "cfgDependencies") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set PackageName)) :*: (S1 ('MetaSel ('Just "cfgUnsafe") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "cfgDebug") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "cfgCheckIdempotence") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "cfgSourceType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SourceType) :*: S1 ('MetaSel ('Just "cfgColorMode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ColorMode))) :*: (S1 ('MetaSel ('Just "cfgRegion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 region) :*: (S1 ('MetaSel ('Just "cfgPrinterOpts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PrinterOptsTotal) :*: S1 ('MetaSel ('Just "cfgLocalModules") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set ModuleName)))))))

Methods

from :: Config region -> Rep (Config region) x #

to :: Rep (Config region) x -> Config region #

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 #

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

Defined in Ormolu.Config

Methods

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

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

type Rep (Config region) Source # 
Instance details

Defined in Ormolu.Config

type Rep (Config region) = D1 ('MetaData "Config" "Ormolu.Config" "fourmolu-0.19.0.0-2A7Bw6e6QcF3ynYdkj9bKa" 'False) (C1 ('MetaCons "Config" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cfgDynOptions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [DynOption]) :*: (S1 ('MetaSel ('Just "cfgFixityOverrides") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FixityOverrides) :*: S1 ('MetaSel ('Just "cfgModuleReexports") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ModuleReexports))) :*: (S1 ('MetaSel ('Just "cfgDependencies") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set PackageName)) :*: (S1 ('MetaSel ('Just "cfgUnsafe") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "cfgDebug") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "cfgCheckIdempotence") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "cfgSourceType") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SourceType) :*: S1 ('MetaSel ('Just "cfgColorMode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ColorMode))) :*: (S1 ('MetaSel ('Just "cfgRegion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 region) :*: (S1 ('MetaSel ('Just "cfgPrinterOpts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PrinterOptsTotal) :*: S1 ('MetaSel ('Just "cfgLocalModules") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set ModuleName)))))))

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
Show RegionIndices Source # 
Instance details

Defined in Ormolu.Config

Eq 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
Show RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

Eq RegionDeltas Source # 
Instance details

Defined in Ormolu.Config

data SourceType Source #

Type of sources that can be formatted by Ormolu.

Constructors

ModuleSource

Consider the input as a regular Haskell module

SignatureSource

Consider the input as a Backpack module signature

Instances

Instances details
Show SourceType Source # 
Instance details

Defined in Ormolu.Config

Eq SourceType Source # 
Instance details

Defined in Ormolu.Config

overapproximatedDependencies :: Config region -> Set PackageName Source #

Return all dependencies of the module. This includes both the declared dependencies of the component we are working with and all potential module re-export targets.

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
Show DynOption Source # 
Instance details

Defined in Ormolu.Config

Eq DynOption Source # 
Instance details

Defined in Ormolu.Config

Ord DynOption Source # 
Instance details

Defined in Ormolu.Config

Fourmolu configuration

data PrinterOpts (f :: Type -> Type) Source #

Options controlling formatting output.

Constructors

PrinterOpts 

Fields

Instances

Instances details
FromJSON PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Monoid PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Semigroup PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Show PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsPartial Source # 
Instance details

Defined in Ormolu.Config

Eq PrinterOptsTotal Source # 
Instance details

Defined in Ormolu.Config

Generic (PrinterOpts f) Source # 
Instance details

Defined in Ormolu.Config.Gen

Associated Types

type Rep (PrinterOpts f) 
Instance details

Defined in Ormolu.Config.Gen

type Rep (PrinterOpts f)

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.Gen

type Rep (PrinterOpts f)

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.

fillMissingPrinterOpts :: forall (f :: Type -> Type). Applicative f => PrinterOpts Maybe -> 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.

resolvePrinterOpts :: [PrinterOptsPartial] -> PrinterOptsTotal Source #

Apply the given configuration in order (later options override earlier).

data FunctionArrowsStyle Source #

data HaddockLocSignature Source #

data InStyle Source #

Instances

Instances details
FromJSON InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Bounded InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Enum InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Show InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

(==) :: InStyle -> InStyle -> Bool #

(/=) :: InStyle -> InStyle -> Bool #

data IfStyle Source #

Constructors

IfIndented 
IfHanging 

Instances

Instances details
FromJSON IfStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Bounded IfStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Enum IfStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Show IfStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq IfStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

(==) :: IfStyle -> IfStyle -> Bool #

(/=) :: IfStyle -> IfStyle -> Bool #

data Unicode Source #

Instances

Instances details
FromJSON Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Bounded Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Enum Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Show Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

(==) :: Unicode -> Unicode -> Bool #

(/=) :: Unicode -> Unicode -> Bool #

data SingleDerivingParens Source #

parsePrinterOptsCLI :: Applicative f => (forall a. PrinterOptsFieldType a => String -> String -> String -> f (Maybe a)) -> f (PrinterOpts Maybe) Source #

parsePrinterOptType :: PrinterOptsFieldType a => String -> Either String a Source #

renderPrinterOpt :: RenderPrinterOpt a => a -> String Source #

Loading Fourmolu configuration

data ConfigNotFound Source #

Constructors

ConfigNotFound 

Fields

Instances

Instances details
Show ConfigNotFound Source # 
Instance details

Defined in Ormolu.Config

findConfigFile :: FilePath -> IO (Either ConfigNotFound FilePath) Source #

Find a fourmolu configuration file.

Looks for a file named fourmolu.yaml, first in the given path and its parents, and then in the XDG config directory.

configFileName :: FilePath Source #

Expected file name for YAML config.

Orphan instances