Copyright | (c) 2019-2022 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module contains data types representing Headroom configuration options. Related logic is available in Headroom.Configuration module.
Data types related to Headroom configuration uses the
partial options monoid
pattern, but instead of defining separate data type for each phase
(partial or complete configuration), the phase is expressed by the Phase
data type and related closed type family.
Synopsis
- data ConfigurationError
- data ConfigurationKey
- = CkFileExtensions FileType
- | CkHeaderSyntax FileType
- | CkMarginTopCode FileType
- | CkMarginTopFile FileType
- | CkMarginBottomCode FileType
- | CkMarginBottomFile FileType
- | CkPutAfter FileType
- | CkPutBefore FileType
- | CkRunMode
- | CkSourcePaths
- | CkExcludedPaths
- | CkExcludeIgnoredPaths
- | CkBuiltInTemplates
- | CkVariables
- | CkEnabled
- data Phase
- type family (p :: Phase) ::: a where ...
- data AppConfig (p :: Phase) = AppConfig {
- acRunMode :: p ::: RunMode
- acSourcePaths :: p ::: [FilePath]
- acExcludedPaths :: p ::: [Regex]
- acExcludeIgnoredPaths :: p ::: Bool
- acBuiltInTemplates :: p ::: Maybe LicenseType
- acTemplateRefs :: [TemplateRef]
- acVariables :: Variables
- acLicenseHeaders :: HeadersConfig p
- acPostProcessConfigs :: PostProcessConfigs p
- type CtAppConfig = AppConfig 'Complete
- type PtAppConfig = AppConfig 'Partial
- data HeadersConfig (p :: Phase) = HeadersConfig {
- hscC :: HeaderConfig p
- hscCpp :: HeaderConfig p
- hscCss :: HeaderConfig p
- hscDart :: HeaderConfig p
- hscGo :: HeaderConfig p
- hscHaskell :: HeaderConfig p
- hscHtml :: HeaderConfig p
- hscJava :: HeaderConfig p
- hscJs :: HeaderConfig p
- hscKotlin :: HeaderConfig p
- hscPhp :: HeaderConfig p
- hscPureScript :: HeaderConfig p
- hscRust :: HeaderConfig p
- hscScala :: HeaderConfig p
- hscShell :: HeaderConfig p
- type CtHeadersConfig = HeadersConfig 'Complete
- type PtHeadersConfig = HeadersConfig 'Partial
- data HeaderConfig (p :: Phase) = HeaderConfig {
- hcFileExtensions :: p ::: [Text]
- hcMarginTopCode :: p ::: Int
- hcMarginTopFile :: p ::: Int
- hcMarginBottomCode :: p ::: Int
- hcMarginBottomFile :: p ::: Int
- hcPutAfter :: p ::: [Regex]
- hcPutBefore :: p ::: [Regex]
- hcHeaderSyntax :: p ::: HeaderSyntax
- type CtHeaderConfig = HeaderConfig 'Complete
- type PtHeaderConfig = HeaderConfig 'Partial
- type CtUpdateCopyrightConfig = UpdateCopyrightConfig 'Complete
- type PtUpdateCopyrightConfig = UpdateCopyrightConfig 'Partial
- data UpdateCopyrightConfig (p :: Phase) = UpdateCopyrightConfig {
- uccSelectedAuthors :: p ::: Maybe (NonEmpty Text)
- type CtPostProcessConfig c = PostProcessConfig 'Complete c
- type PtPostProcessConfig c = PostProcessConfig 'Partial c
- data PostProcessConfig (p :: Phase) c = PostProcessConfig {
- ppcEnabled :: p ::: Bool
- ppcConfig :: c p
- type CtPostProcessConfigs = PostProcessConfigs 'Complete
- type PtPostProcessConfigs = PostProcessConfigs 'Partial
- data PostProcessConfigs (p :: Phase) = PostProcessConfigs {}
- data HeaderSyntax
- = BlockComment Regex Regex (Maybe Text)
- | LineComment Regex (Maybe Text)
- data GenMode
- data LicenseType
- data RunMode
Error Types
data ConfigurationError Source #
Exception specific to the Headroom.Configuration module.
MissingConfiguration ConfigurationKey | some of the required configuration keys has not been specified |
MixedHeaderSyntax | illegal configuration for |
Instances
Eq ConfigurationError Source # | |
Defined in Headroom.Config.Types (==) :: ConfigurationError -> ConfigurationError -> Bool # (/=) :: ConfigurationError -> ConfigurationError -> Bool # | |
Show ConfigurationError Source # | |
Defined in Headroom.Config.Types showsPrec :: Int -> ConfigurationError -> ShowS # show :: ConfigurationError -> String # showList :: [ConfigurationError] -> ShowS # | |
Exception ConfigurationError Source # | |
Defined in Headroom.Config.Types |
data ConfigurationKey Source #
Represents single key in the configuration.
CkFileExtensions FileType | no configuration for |
CkHeaderSyntax FileType | no configuration for header syntax |
CkMarginTopCode FileType | no configuration for margin between header top and preceding code |
CkMarginTopFile FileType | no configuration for margin between header top and start of file |
CkMarginBottomCode FileType | no configuration for margin between header bottom and following code |
CkMarginBottomFile FileType | no configuration for margin between header bottom and end of file |
CkPutAfter FileType | no configuration for |
CkPutBefore FileType | no configuration for |
CkRunMode | no configuration for |
CkSourcePaths | no configuration for |
CkExcludedPaths | no configuration for |
CkExcludeIgnoredPaths | no configuration for |
CkBuiltInTemplates | no configuration for built in templates |
CkVariables | no configuration for |
CkEnabled | no configuration for |
Instances
Eq ConfigurationKey Source # | |
Defined in Headroom.Config.Types (==) :: ConfigurationKey -> ConfigurationKey -> Bool # (/=) :: ConfigurationKey -> ConfigurationKey -> Bool # | |
Show ConfigurationKey Source # | |
Defined in Headroom.Config.Types showsPrec :: Int -> ConfigurationKey -> ShowS # show :: ConfigurationKey -> String # showList :: [ConfigurationKey] -> ShowS # |
Type Families
Data type representing state of given configuration data type.
type family (p :: Phase) ::: a where ... Source #
Closed type family used to express the phase of given data type.
Data Types
Top Level Configuration
data AppConfig (p :: Phase) Source #
Application configuration.
AppConfig | |
|
Instances
data HeadersConfig (p :: Phase) Source #
Group of HeaderConfig
configurations for supported file types.
HeadersConfig | |
|
Instances
type CtHeadersConfig = HeadersConfig 'Complete Source #
Alias for complete variant of HeadersConfig
.
type PtHeadersConfig = HeadersConfig 'Partial Source #
Alias for partial variant of HeadersConfig
.
data HeaderConfig (p :: Phase) Source #
Configuration for specific license header.
HeaderConfig | |
|
Instances
type CtHeaderConfig = HeaderConfig 'Complete Source #
Alias for complete variant of HeaderConfig
.
type PtHeaderConfig = HeaderConfig 'Partial Source #
Alias for partial variant of HeaderConfig
.
Header Functions
type CtUpdateCopyrightConfig = UpdateCopyrightConfig 'Complete Source #
Alias for complete variant of UpdateCopyrightConfig
.
type PtUpdateCopyrightConfig = UpdateCopyrightConfig 'Partial Source #
Alias for partial variant of UpdateCopyrightConfig
.
data UpdateCopyrightConfig (p :: Phase) Source #
Main configuration for the Headroom.PostProcess.UpdateCopyright post-processor.
UpdateCopyrightConfig | |
|
Instances
type CtPostProcessConfig c = PostProcessConfig 'Complete c Source #
Alias for complete variant of PostProcessConfig
.
type PtPostProcessConfig c = PostProcessConfig 'Partial c Source #
Alias for partial variant of PostProcessConfig
.
data PostProcessConfig (p :: Phase) c Source #
Configuration for selected post-processor.
PostProcessConfig | |
|
Instances
type CtPostProcessConfigs = PostProcessConfigs 'Complete Source #
Alias for complete variant of PostProcessConfigs
.
type PtPostProcessConfigs = PostProcessConfigs 'Partial Source #
Alias for partial variant of PostProcessConfigs
.
data PostProcessConfigs (p :: Phase) Source #
Configuration of all known post-processors.
PostProcessConfigs | |
|
Instances
Additional Data Types
data HeaderSyntax Source #
Syntax of the license header comment.
BlockComment Regex Regex (Maybe Text) | block (multi-line) comment syntax (e.g. |
LineComment Regex (Maybe Text) | single line comment syntax (e.g. |
Instances
Eq HeaderSyntax Source # | |
Defined in Headroom.Config.Types (==) :: HeaderSyntax -> HeaderSyntax -> Bool # (/=) :: HeaderSyntax -> HeaderSyntax -> Bool # | |
Show HeaderSyntax Source # | |
Defined in Headroom.Config.Types showsPrec :: Int -> HeaderSyntax -> ShowS # show :: HeaderSyntax -> String # showList :: [HeaderSyntax] -> ShowS # |
Represents what action should the gen
command perform.
GenConfigFile | generate YAML config file stub |
GenLicense (LicenseType, FileType) | generate license header template |
data LicenseType Source #
Supported type of open source license.
Apache2 | support for Apache-2.0 license |
BSD3 | support for BSD-3-Clause license |
GPL2 | support for GNU GPL2 license |
GPL3 | support for GNU GPL3 license |
MIT | support for MIT license |
MPL2 | support for MPL2 license |