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

Headroom.Command.Run

Description

Module representing the run command, the core command of Headroom, which is responsible for license header management.

Synopsis

Documentation

commandRun Source #

Arguments

:: CommandRunOptions

Run command options

-> IO ()

execution result

Handler for Run command.

loadTemplateRefs Source #

Arguments

:: forall a env. (Template a, Has (Network (RIO env)) env, Has (FileSystem (RIO env)) env, HasLogFunc env) 
=> [TemplateRef]

template references

-> RIO env (Map FileType a)

map of templates

Loads templates using given template references. If multiple sources define template for the same FileType, then the preferred one (based on ordering of TemplateRef is selected).

typeOfTemplate Source #

Arguments

:: HasLogFunc env 
=> FilePath

path to the template file

-> RIO env (Maybe FileType)

detected template type

Takes path to the template file and returns detected type of the template.

License Header Post-processing

postProcessHeader' Source #

Arguments

:: forall a env. (Template a, Has CtPostProcessConfigs env, Has CurrentYear env) 
=> HeaderSyntax

syntax of the license header comments

-> Variables

template variables

-> Text

license header to post-process

-> RIO env Text

post-processed license header

Performs post-processing on rendered license header, based on given configuration. Currently the main points are to:

  1. sanitize possibly corrupted comment syntax (sanitizeSyntax)
  2. apply post-processors (postProcessHeader)