headroom-0.4.1.0: License Header Manager
Copyright(c) 2019-2021 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Configuration.Types

Description

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

Error Types

data ConfigurationKey Source #

Represents single key in the configuration.

Constructors

CkFileExtensions FileType

no configuration for file-extensions

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 put-after

CkPutBefore FileType

no configuration for put-before

CkRunMode

no configuration for run-mode

CkSourcePaths

no configuration for source-paths

CkExcludedPaths

no configuration for excluded-paths

CkTemplateSource

no configuration for template source

CkVariables

no configuration for variables

CkEnabled

no configuration for enabled

Type Families

data Phase Source #

Data type representing state of given configuration data type.

Constructors

Partial

partial configuration, could be combined with another or validated to produce the complete configuration

Complete

complete configuration, result of combining and validation of partial configuration

type family (p :: Phase) ::: a where ... Source #

Closed type family used to express the phase of given data type.

Equations

'Partial ::: a = Last a 
'Complete ::: a = a 

Data Types

Top Level Configuration

data Configuration (p :: Phase) Source #

Application configuration.

Constructors

Configuration 

Fields

Instances

Instances details
Eq PtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq CtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

Show PtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

Show CtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

Generic PtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

Associated Types

type Rep PtConfiguration :: Type -> Type #

Semigroup PtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

Monoid PtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

FromJSON PtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtConfiguration Source # 
Instance details

Defined in Headroom.Configuration.Types

type CtConfiguration = Configuration 'Complete Source #

Alias for complete variant of Configuration.

type PtConfiguration = Configuration 'Partial Source #

Alias for partial variant of Configuration.

data HeadersConfig (p :: Phase) Source #

Group of HeaderConfig configurations for supported file types.

Constructors

HeadersConfig 

Fields

Instances

Instances details
Eq PtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq CtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Show PtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Show CtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Generic PtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Associated Types

type Rep PtHeadersConfig :: Type -> Type #

Semigroup PtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Monoid PtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

FromJSON PtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtHeadersConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtHeadersConfig = D1 ('MetaData "HeadersConfig" "Headroom.Configuration.Types" "headroom-0.4.1.0-3kfD3NY5xN1DFOkiPhzRsE" 'False) (C1 ('MetaCons "HeadersConfig" 'PrefixI 'True) (((S1 ('MetaSel ('Just "hscC") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: (S1 ('MetaSel ('Just "hscCpp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: S1 ('MetaSel ('Just "hscCss") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)))) :*: (S1 ('MetaSel ('Just "hscGo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: (S1 ('MetaSel ('Just "hscHaskell") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: S1 ('MetaSel ('Just "hscHtml") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial))))) :*: ((S1 ('MetaSel ('Just "hscJava") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: (S1 ('MetaSel ('Just "hscJs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: S1 ('MetaSel ('Just "hscPureScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)))) :*: (S1 ('MetaSel ('Just "hscRust") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: (S1 ('MetaSel ('Just "hscScala") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)) :*: S1 ('MetaSel ('Just "hscShell") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderConfig 'Partial)))))))

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.

Constructors

HeaderConfig 

Fields

Instances

Instances details
Eq PtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq CtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Show PtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Show CtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Generic PtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Associated Types

type Rep PtHeaderConfig :: Type -> Type #

Semigroup PtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Monoid PtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

FromJSON PtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtHeaderConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

type CtHeaderConfig = HeaderConfig 'Complete Source #

Alias for complete variant of HeaderConfig.

type PtHeaderConfig = HeaderConfig 'Partial Source #

Alias for partial variant of HeaderConfig.

Header Functions

data UpdateCopyrightConfig (p :: Phase) Source #

Main configuration for the Headroom.HeaderFn.UpdateCopyright license header function.

Constructors

UpdateCopyrightConfig 

Fields

Instances

Instances details
Eq PtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq CtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Show PtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Show CtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Generic PtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Associated Types

type Rep PtUpdateCopyrightConfig :: Type -> Type #

Semigroup PtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

Monoid PtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

FromJSON PtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtUpdateCopyrightConfig Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtUpdateCopyrightConfig = D1 ('MetaData "UpdateCopyrightConfig" "Headroom.Configuration.Types" "headroom-0.4.1.0-3kfD3NY5xN1DFOkiPhzRsE" 'False) (C1 ('MetaCons "UpdateCopyrightConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "uccSelectedAuthors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ('Partial ::: Maybe (NonEmpty Text)))))

type CtHeaderFnConfig c = HeaderFnConfig 'Complete c Source #

Alias for complete variant of HeaderFnConfig.

type PtHeaderFnConfig c = HeaderFnConfig 'Partial c Source #

Alias for partial variant of HeaderFnConfig.

data HeaderFnConfig (p :: Phase) c Source #

Configuration for selected license header function.

Constructors

HeaderFnConfig 

Fields

  • hfcEnabled :: p ::: Bool

    whether this function is enabled or not

  • hfcConfig :: c p

    custom configuration of the license header function

Instances

Instances details
Eq (c 'Partial) => Eq (PtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq (c 'Complete) => Eq (CtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (c 'Partial) => Show (PtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (c 'Complete) => Show (CtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Generic (PtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Associated Types

type Rep (PtHeaderFnConfig c) :: Type -> Type #

Semigroup (c 'Partial) => Semigroup (PtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Monoid (c 'Partial) => Monoid (PtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

(FromJSON (c 'Partial), Monoid (c 'Partial)) => FromJSON (PtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep (PtHeaderFnConfig c) Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep (PtHeaderFnConfig c) = D1 ('MetaData "HeaderFnConfig" "Headroom.Configuration.Types" "headroom-0.4.1.0-3kfD3NY5xN1DFOkiPhzRsE" 'False) (C1 ('MetaCons "HeaderFnConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "hfcEnabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ('Partial ::: Bool)) :*: S1 ('MetaSel ('Just "hfcConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (c 'Partial))))

type CtHeaderFnConfigs = HeaderFnConfigs 'Complete Source #

Alias for complete variant of HeaderFnConfigs.

type PtHeaderFnConfigs = HeaderFnConfigs 'Partial Source #

Alias for partial variant of HeaderFnConfigs.

data HeaderFnConfigs (p :: Phase) Source #

Configuration of all known license header functions.

Constructors

HeaderFnConfigs 

Fields

Instances

Instances details
Eq PtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq CtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

Show PtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

Show CtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

Generic PtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

Associated Types

type Rep PtHeaderFnConfigs :: Type -> Type #

Semigroup PtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

Monoid PtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

FromJSON PtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtHeaderFnConfigs Source # 
Instance details

Defined in Headroom.Configuration.Types

type Rep PtHeaderFnConfigs = D1 ('MetaData "HeaderFnConfigs" "Headroom.Configuration.Types" "headroom-0.4.1.0-3kfD3NY5xN1DFOkiPhzRsE" 'False) (C1 ('MetaCons "HeaderFnConfigs" 'PrefixI 'True) (S1 ('MetaSel ('Just "hfcsUpdateCopyright") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (HeaderFnConfig 'Partial UpdateCopyrightConfig))))

Additional Data Types

data HeaderSyntax Source #

Syntax of the license header comment.

Constructors

BlockComment Regex Regex (Maybe Text)

block (multi-line) comment syntax (e.g. * *)

LineComment Regex (Maybe Text)

single line comment syntax (e.g. //)

Instances

Instances details
Eq HeaderSyntax Source # 
Instance details

Defined in Headroom.Configuration.Types

Show HeaderSyntax Source # 
Instance details

Defined in Headroom.Configuration.Types

data GenMode Source #

Represents what action should the gen command perform.

Constructors

GenConfigFile

generate YAML config file stub

GenLicense (LicenseType, FileType)

generate license header template

Instances

Instances details
Eq GenMode Source # 
Instance details

Defined in Headroom.Configuration.Types

Methods

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

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

Show GenMode Source # 
Instance details

Defined in Headroom.Configuration.Types

data LicenseType Source #

Supported type of open source license.

Constructors

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

Instances

Instances details
Bounded LicenseType Source # 
Instance details

Defined in Headroom.Configuration.Types

Enum LicenseType Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq LicenseType Source # 
Instance details

Defined in Headroom.Configuration.Types

Ord LicenseType Source # 
Instance details

Defined in Headroom.Configuration.Types

Show LicenseType Source # 
Instance details

Defined in Headroom.Configuration.Types

EnumExtra LicenseType Source # 
Instance details

Defined in Headroom.Configuration.Types

data RunMode Source #

Represents what action should the run command perform.

Constructors

Add

add mode for run command

Check

check mode for run command

Drop

drop mode for run command

Replace

replace mode for run command

Instances

Instances details
Eq RunMode Source # 
Instance details

Defined in Headroom.Configuration.Types

Methods

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

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

Show RunMode Source # 
Instance details

Defined in Headroom.Configuration.Types

FromJSON RunMode Source # 
Instance details

Defined in Headroom.Configuration.Types

data TemplateSource Source #

Source of license templates

Constructors

TemplateFiles [FilePath]

templates are stored as local files

BuiltInTemplates LicenseType

use built-in templates for selected license