fourmolu-0.15.0.0: A formatter for Haskell source code
Safe HaskellSafe-Inferred
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) :: Type -> Type #

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

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 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) :: 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.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. 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 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 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 #

Loading Fourmolu configuration

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.

Orphan instances