| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Ormolu.Config
Description
Configuration options used by the tool.
Synopsis
- data Config region = Config {
- cfgDynOptions :: ![DynOption]
- cfgFixityOverrides :: FixityMap
- cfgDependencies :: !(Set String)
- cfgUnsafe :: !Bool
- cfgDebug :: !Bool
- cfgCheckIdempotence :: !Bool
- cfgSourceType :: !SourceType
- cfgColorMode :: !ColorMode
- cfgRegion :: !region
- cfgPrinterOpts :: !PrinterOptsTotal
- data ColorMode
- data RegionIndices = RegionIndices {
- regionStartLine :: !(Maybe Int)
- regionEndLine :: !(Maybe Int)
- data RegionDeltas = RegionDeltas {}
- data SourceType
- defaultConfig :: Config RegionIndices
- regionIndicesToDeltas :: Int -> RegionIndices -> RegionDeltas
- newtype DynOption = DynOption {}
- dynOptionToLocatedStr :: DynOption -> Located String
- data PrinterOpts f = PrinterOpts {
- poIndentation :: f Int
- poFunctionArrows :: f FunctionArrowsStyle
- poCommaStyle :: f CommaStyle
- poImportExportStyle :: f ImportExportStyle
- poIndentWheres :: f Bool
- poRecordBraceSpace :: f Bool
- poNewlinesBetweenDecls :: f Int
- poHaddockStyle :: f HaddockPrintStyle
- poRespectful :: f Bool
- type PrinterOptsPartial = PrinterOpts Maybe
- type PrinterOptsTotal = PrinterOpts Identity
- defaultPrinterOpts :: PrinterOptsTotal
- fillMissingPrinterOpts :: forall f. Applicative f => PrinterOptsPartial -> PrinterOpts f -> PrinterOpts f
- data CommaStyle
- data HaddockPrintStyle
- data ImportExportStyle
- loadConfigFile :: FilePath -> IO ConfigFileLoadResult
- configFileName :: FilePath
- data FourmoluConfig = FourmoluConfig {}
- emptyConfig :: FourmoluConfig
- data ConfigFileLoadResult
- data PrinterOptsFieldMeta a where
- PrinterOptsFieldMeta :: PrinterOptsFieldType a => {..} -> PrinterOptsFieldMeta a
- class PrinterOptsFieldType a where
- printerOptsMeta :: PrinterOpts PrinterOptsFieldMeta
- overFields :: (forall a. f a -> g a) -> PrinterOpts f -> PrinterOpts g
- overFieldsM :: Applicative m => (forall a. f a -> m (g a)) -> PrinterOpts f -> m (PrinterOpts g)
Documentation
Ormolu configuration.
Constructors
| Config | |
Fields
| |
Instances
Whether to use colors and other features of ANSI terminals.
Instances
| Bounded ColorMode Source # | |
| Enum ColorMode Source # | |
Defined in Ormolu.Terminal Methods succ :: ColorMode -> ColorMode # pred :: ColorMode -> ColorMode # fromEnum :: ColorMode -> Int # enumFrom :: ColorMode -> [ColorMode] # enumFromThen :: ColorMode -> ColorMode -> [ColorMode] # enumFromTo :: ColorMode -> ColorMode -> [ColorMode] # enumFromThenTo :: ColorMode -> ColorMode -> ColorMode -> [ColorMode] # | |
| Show ColorMode Source # | |
| Eq ColorMode Source # | |
data RegionIndices Source #
Region selection as the combination of start and end line numbers.
Constructors
| RegionIndices | |
Fields
| |
Instances
| Show RegionIndices Source # | |
Defined in Ormolu.Config Methods showsPrec :: Int -> RegionIndices -> ShowS # show :: RegionIndices -> String # showList :: [RegionIndices] -> ShowS # | |
| Eq RegionIndices Source # | |
Defined in Ormolu.Config Methods (==) :: RegionIndices -> RegionIndices -> Bool # (/=) :: RegionIndices -> RegionIndices -> Bool # | |
data RegionDeltas Source #
Region selection as the length of the literal prefix and the literal suffix.
Constructors
| RegionDeltas | |
Fields
| |
Instances
| Show RegionDeltas Source # | |
Defined in Ormolu.Config Methods showsPrec :: Int -> RegionDeltas -> ShowS # show :: RegionDeltas -> String # showList :: [RegionDeltas] -> ShowS # | |
| Eq RegionDeltas Source # | |
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
| Show SourceType Source # | |
Defined in Ormolu.Config Methods showsPrec :: Int -> SourceType -> ShowS # show :: SourceType -> String # showList :: [SourceType] -> ShowS # | |
| Eq SourceType Source # | |
Defined in Ormolu.Config | |
defaultConfig :: Config RegionIndices Source #
Default .Config RegionIndices
regionIndicesToDeltas Source #
Arguments
| :: Int | Total number of lines in the input |
| -> RegionIndices | Region indices |
| -> RegionDeltas | Region deltas |
Convert RegionIndices into RegionDeltas.
A wrapper for dynamic options.
Constructors
| DynOption | |
Fields | |
Instances
| Show DynOption Source # | |
| Eq DynOption Source # | |
| Ord DynOption Source # | |
Fourmolu configuration
data PrinterOpts f Source #
Options controlling formatting output.
Constructors
| PrinterOpts | |
Fields
| |
Instances
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 => 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 #
Instances
| Bounded CommaStyle Source # | |
Defined in Ormolu.Config.Types | |
| Enum CommaStyle Source # | |
Defined in Ormolu.Config.Types Methods succ :: CommaStyle -> CommaStyle # pred :: CommaStyle -> CommaStyle # toEnum :: Int -> CommaStyle # fromEnum :: CommaStyle -> Int # enumFrom :: CommaStyle -> [CommaStyle] # enumFromThen :: CommaStyle -> CommaStyle -> [CommaStyle] # enumFromTo :: CommaStyle -> CommaStyle -> [CommaStyle] # enumFromThenTo :: CommaStyle -> CommaStyle -> CommaStyle -> [CommaStyle] # | |
| Show CommaStyle Source # | |
Defined in Ormolu.Config.Types Methods showsPrec :: Int -> CommaStyle -> ShowS # show :: CommaStyle -> String # showList :: [CommaStyle] -> ShowS # | |
| PrinterOptsFieldType CommaStyle Source # | |
Defined in Ormolu.Config | |
| Eq CommaStyle Source # | |
Defined in Ormolu.Config.Types | |
data HaddockPrintStyle Source #
Constructors
| HaddockSingleLine | |
| HaddockMultiLine | |
| HaddockMultiLineCompact |
Instances
data ImportExportStyle Source #
Instances
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.
data FourmoluConfig Source #
Constructors
| FourmoluConfig | |
Fields | |
Instances
| FromJSON FourmoluConfig Source # | |
Defined in Ormolu.Config Methods parseJSON :: Value -> Parser FourmoluConfig # parseJSONList :: Value -> Parser [FourmoluConfig] # | |
| Show FourmoluConfig Source # | |
Defined in Ormolu.Config Methods showsPrec :: Int -> FourmoluConfig -> ShowS # show :: FourmoluConfig -> String # showList :: [FourmoluConfig] -> ShowS # | |
| Eq FourmoluConfig Source # | |
Defined in Ormolu.Config Methods (==) :: FourmoluConfig -> FourmoluConfig -> Bool # (/=) :: FourmoluConfig -> FourmoluConfig -> Bool # | |
data ConfigFileLoadResult Source #
The result of calling loadConfigFile.
Constructors
| ConfigLoaded FilePath FourmoluConfig | |
| ConfigParseError FilePath ParseException | |
| ConfigNotFound [FilePath] |
Instances
| Show ConfigFileLoadResult Source # | |
Defined in Ormolu.Config Methods showsPrec :: Int -> ConfigFileLoadResult -> ShowS # show :: ConfigFileLoadResult -> String # showList :: [ConfigFileLoadResult] -> ShowS # | |
Utilities
data PrinterOptsFieldMeta a where Source #
Source of truth for how PrinterOpts is parsed from configuration sources.
Constructors
| PrinterOptsFieldMeta | |
Fields
| |
class PrinterOptsFieldType a where Source #
Minimal complete definition
Nothing
Instances
overFields :: (forall a. f a -> g a) -> PrinterOpts f -> PrinterOpts g Source #
overFieldsM :: Applicative m => (forall a. f a -> m (g a)) -> PrinterOpts f -> m (PrinterOpts g) Source #