headroom-0.2.2.1: License Header Manager

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

Headroom.Types

Contents

Description

Module containing most of the data types used by the application.

Synopsis

Configuration Data Types

Total Configuration

data Configuration Source #

Application configuration.

Constructors

Configuration 

Fields

data HeaderConfig Source #

Configuration for specific license header.

Constructors

HeaderConfig 

Fields

Instances
Eq HeaderConfig Source # 
Instance details

Defined in Headroom.Types

Show HeaderConfig Source # 
Instance details

Defined in Headroom.Types

data HeadersConfig Source #

Group of HeaderConfig configurations for supported file types.

Constructors

HeadersConfig 

Fields

Partial Configuration

data PartialConfiguration Source #

Partial (possibly incomplete) version of Configuration.

Constructors

PartialConfiguration 

Fields

Instances
Eq PartialConfiguration Source # 
Instance details

Defined in Headroom.Types

Show PartialConfiguration Source # 
Instance details

Defined in Headroom.Types

Generic PartialConfiguration Source # 
Instance details

Defined in Headroom.Types

Associated Types

type Rep PartialConfiguration :: Type -> Type #

Semigroup PartialConfiguration Source # 
Instance details

Defined in Headroom.Types

Monoid PartialConfiguration Source # 
Instance details

Defined in Headroom.Types

FromJSON PartialConfiguration Source # 
Instance details

Defined in Headroom.Types

type Rep PartialConfiguration Source # 
Instance details

Defined in Headroom.Types

data PartialHeaderConfig Source #

Partial (possibly incomplete) version of HeaderConfig.

Constructors

PartialHeaderConfig 

Fields

Instances
Eq PartialHeaderConfig Source # 
Instance details

Defined in Headroom.Types

Show PartialHeaderConfig Source # 
Instance details

Defined in Headroom.Types

Generic PartialHeaderConfig Source # 
Instance details

Defined in Headroom.Types

Associated Types

type Rep PartialHeaderConfig :: Type -> Type #

Semigroup PartialHeaderConfig Source # 
Instance details

Defined in Headroom.Types

Monoid PartialHeaderConfig Source # 
Instance details

Defined in Headroom.Types

FromJSON PartialHeaderConfig Source # 
Instance details

Defined in Headroom.Types

type Rep PartialHeaderConfig Source # 
Instance details

Defined in Headroom.Types

type Rep PartialHeaderConfig = D1 (MetaData "PartialHeaderConfig" "Headroom.Types" "headroom-0.2.2.1-6EQTB6V8TeGE4qBFJCSnq" False) (C1 (MetaCons "PartialHeaderConfig" PrefixI True) ((S1 (MetaSel (Just "phcFileExtensions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Last [Text])) :*: (S1 (MetaSel (Just "phcMarginAfter") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Last Int)) :*: S1 (MetaSel (Just "phcMarginBefore") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Last Int)))) :*: (S1 (MetaSel (Just "phcPutAfter") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Last [Text])) :*: (S1 (MetaSel (Just "phcPutBefore") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Last [Text])) :*: S1 (MetaSel (Just "phcHeaderSyntax") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Last HeaderSyntax))))))

data PartialHeadersConfig Source #

Partial (possibly incomplete) version of HeadersConfig.

Constructors

PartialHeadersConfig 

Fields

Instances
Eq PartialHeadersConfig Source # 
Instance details

Defined in Headroom.Types

Show PartialHeadersConfig Source # 
Instance details

Defined in Headroom.Types

Generic PartialHeadersConfig Source # 
Instance details

Defined in Headroom.Types

Associated Types

type Rep PartialHeadersConfig :: Type -> Type #

Semigroup PartialHeadersConfig Source # 
Instance details

Defined in Headroom.Types

Monoid PartialHeadersConfig Source # 
Instance details

Defined in Headroom.Types

FromJSON PartialHeadersConfig Source # 
Instance details

Defined in Headroom.Types

type Rep PartialHeadersConfig Source # 
Instance details

Defined in Headroom.Types

Other Configuration 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. //)

Instances
Eq HeaderSyntax Source # 
Instance details

Defined in Headroom.Types

Show HeaderSyntax Source # 
Instance details

Defined in Headroom.Types

Command Data Types

data Command Source #

Application command.

Constructors

Run [FilePath] [Text] [FilePath] [Text] (Maybe RunMode) Bool Bool

run command

Gen Bool (Maybe (LicenseType, FileType))

gen command

Init LicenseType [FilePath]

init command

Instances
Show Command Source # 
Instance details

Defined in Headroom.Types

newtype CommandGenOptions Source #

Options for the gen command.

Constructors

CommandGenOptions 

Fields

data CommandRunOptions Source #

Options for the run command.

Constructors

CommandRunOptions 

Fields

data ConfigurationError Source #

Error during processing configuration.

Constructors

InvalidVariable !Text

invalid variable input (as key=value)

MixedHeaderSyntax

illegal configuration for HeaderSyntax

NoFileExtensions !FileType

no configuration for file-extensions

NoHeaderSyntax !FileType

no configuration for header syntax

NoMarginAfter !FileType

no configuration for margin-after

NoMarginBefore !FileType

no configuration for margin-before

NoPutAfter !FileType

no configuration for put-after

NoPutBefore !FileType

no configuration for put-before

NoRunMode

no configuration for run-mode

NoSourcePaths

no configuration for source-paths

NoExcludedPaths

no configuration for excluded-paths

NoTemplatePaths

no configuration for template-paths

NoVariables

no configuration for variables

data RunAction Source #

Action to be performed based on the selected RunMode.

Constructors

RunAction 

Fields

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

Methods

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

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

Show RunMode Source # 
Instance details

Defined in Headroom.Types

FromJSON RunMode Source # 
Instance details

Defined in Headroom.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
Eq GenMode Source # 
Instance details

Defined in Headroom.Types

Methods

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

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

Show GenMode Source # 
Instance details

Defined in Headroom.Types

Error Data Types

data ApplicationError Source #

Represents error that can occur during the application execution.

Constructors

CommandGenError !CommandGenError

error specific for the gen command

CommandInitError !CommandInitError

error specific for the init command

ConfigurationError !ConfigurationError

error processing configuration

TemplateError !TemplateError

error processing template

data CommandGenError Source #

Error specific for the gen command.

Constructors

NoGenModeSelected

no mode of Gen command selected

data CommandInitError Source #

Error specific for the init command.

Constructors

AppConfigAlreadyExists !FilePath

application configuration file already exists

NoProvidedSourcePaths

no paths to source code files provided

NoSupportedFileType

no supported file types found on source paths

data TemplateError Source #

Error during processing template.

Constructors

MissingVariables !Text ![Text]

missing variable values

ParseError !Text

error parsing raw template text

Other Data 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.Types

Enum LicenseType Source # 
Instance details

Defined in Headroom.Types

Eq LicenseType Source # 
Instance details

Defined in Headroom.Types

Ord LicenseType Source # 
Instance details

Defined in Headroom.Types

Show LicenseType Source # 
Instance details

Defined in Headroom.Types

EnumExtra LicenseType Source # 
Instance details

Defined in Headroom.Types

data FileType Source #

Supported type of source code file.

Constructors

C

support for C programming language

CPP

support for C++ programming language

CSS

support for CSS

Haskell

support for Haskell programming language

HTML

support for HTML

Java

support for Java programming language

JS

support for JavaScript programming language

Rust

support for Rust programming language

Scala

support for Scala programming language

Shell

support for Shell

data FileInfo Source #

Info extracted about the concrete source code file.

Constructors

FileInfo 

Fields

Instances
Eq FileInfo Source # 
Instance details

Defined in Headroom.Types

Show FileInfo Source # 
Instance details

Defined in Headroom.Types