fourmolu-0.18.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 Source #

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

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.18.0.0-I5xKVL6TZAA6NMWRE6X4DV" '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 Source #

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

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

Defined in Ormolu.Config

Methods

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

show :: Config region -> String Source #

showList :: [Config region] -> ShowS Source #

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

Defined in Ormolu.Config

Methods

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

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

type Rep (Config region) Source # 
Instance details

Defined in Ormolu.Config

type Rep (Config region) = D1 ('MetaData "Config" "Ormolu.Config" "fourmolu-0.18.0.0-I5xKVL6TZAA6NMWRE6X4DV" '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

Fourmolu configuration

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

Options controlling formatting output.

Constructors

PrinterOpts 

Fields

Instances

Instances details
FromJSON PrinterOptsPartial 
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)
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 #

Instances

Instances details
FromJSON FunctionArrowsStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Bounded FunctionArrowsStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Enum FunctionArrowsStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Show FunctionArrowsStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq FunctionArrowsStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

data HaddockPrintStyle Source #

data ImportExportStyle Source #

data ImportGroup Source #

Constructors

ImportGroup 

Instances

Instances details
FromJSON ImportGroup Source # 
Instance details

Defined in Ormolu.Config.Types

Methods

parseJSON :: Value -> Parser ImportGroup

parseJSONList :: Value -> Parser [ImportGroup]

omittedField :: Maybe ImportGroup

Show ImportGroup Source # 
Instance details

Defined in Ormolu.Config.Types

Eq ImportGroup Source # 
Instance details

Defined in Ormolu.Config.Types

newtype ImportRulePriority Source #

data InStyle Source #

Instances

Instances details
FromJSON InStyle Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

parseJSON :: Value -> Parser InStyle

parseJSONList :: Value -> Parser [InStyle]

omittedField :: Maybe InStyle

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

data Unicode Source #

Instances

Instances details
FromJSON Unicode Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

parseJSON :: Value -> Parser Unicode

parseJSONList :: Value -> Parser [Unicode]

omittedField :: Maybe Unicode

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

data ColumnLimit Source #

Constructors

NoLimit 
ColumnLimit Int 

Instances

Instances details
FromJSON ColumnLimit Source # 
Instance details

Defined in Ormolu.Config.Gen

Methods

parseJSON :: Value -> Parser ColumnLimit

parseJSONList :: Value -> Parser [ColumnLimit]

omittedField :: Maybe ColumnLimit

Show ColumnLimit Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq ColumnLimit Source # 
Instance details

Defined in Ormolu.Config.Gen

data SingleDerivingParens Source #

Instances

Instances details
FromJSON SingleDerivingParens Source # 
Instance details

Defined in Ormolu.Config.Gen

Bounded SingleDerivingParens Source # 
Instance details

Defined in Ormolu.Config.Gen

Enum SingleDerivingParens Source # 
Instance details

Defined in Ormolu.Config.Gen

Show SingleDerivingParens Source # 
Instance details

Defined in Ormolu.Config.Gen

Eq SingleDerivingParens Source # 
Instance details

Defined in Ormolu.Config.Gen

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 #

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

FromJSON PrinterOptsPartial Source # 
Instance details

Monoid PrinterOptsPartial Source # 
Instance details

Semigroup PrinterOptsPartial Source # 
Instance details

Show PrinterOptsPartial Source # 
Instance details

Show PrinterOptsTotal Source # 
Instance details

Eq PrinterOptsPartial Source # 
Instance details

Eq PrinterOptsTotal Source # 
Instance details