headroom-0.3.1.0: License Header Manager

Copyright(c) 2019-2020 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Configuration.Types

Contents

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

CkMarginAfter FileType

no configuration for margin-after

CkMarginBefore FileType

no configuration for margin-before

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

Eq (Configuration Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq (Configuration Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (Configuration Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (Configuration Complete) 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
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

Eq (HeadersConfig Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq (HeadersConfig Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (HeadersConfig Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (HeadersConfig Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

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

Eq (HeaderConfig Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq (HeaderConfig Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (HeaderConfig Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (HeaderConfig Complete) 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
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

Eq (UpdateCopyrightConfig Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq (UpdateCopyrightConfig Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (UpdateCopyrightConfig Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (UpdateCopyrightConfig Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

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

Eq (c Partial) => Eq (HeaderFnConfig Partial c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq (c Complete) => Eq (HeaderFnConfig Complete c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (c Partial) => Show (HeaderFnConfig Partial c) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (c Complete) => Show (HeaderFnConfig Complete c) Source # 
Instance details

Defined in Headroom.Configuration.Types

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

Eq (HeaderFnConfigs Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Eq (HeaderFnConfigs Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (HeaderFnConfigs Partial) Source # 
Instance details

Defined in Headroom.Configuration.Types

Show (HeaderFnConfigs Complete) Source # 
Instance details

Defined in Headroom.Configuration.Types

Additional Data Types

data HeaderSyntax Source #

Syntax of the license header comment.

Constructors

BlockComment Text Text

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

LineComment Text

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

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