Copyright | (c) 2019-2021 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Module representing the run
command, the core command of Headroom, which is
responsible for license header management.
Synopsis
- commandRun :: CommandRunOptions -> IO ()
- loadBuiltInTemplates :: HasLogFunc env => LicenseType -> RIO env (Map FileType TemplateType)
- loadTemplateFiles :: (Has (FileSystem (RIO env)) env, HasLogFunc env) => [FilePath] -> RIO env (Map FileType TemplateType)
- typeOfTemplate :: HasLogFunc env => FilePath -> RIO env (Maybe FileType)
- postProcessHeader' :: (Has CtHeaderFnConfigs env, Has CurrentYear env) => HeaderSyntax -> Variables -> Text -> RIO env Text
Documentation
:: CommandRunOptions | Run command options |
-> IO () | execution result |
Handler for Run command.
:: HasLogFunc env | |
=> LicenseType | license type for which to selected templates |
-> RIO env (Map FileType TemplateType) | map of file types and templates |
Loads built-in templates, stored in Headroom.Embedded, for the given
LicenseType
.
:: (Has (FileSystem (RIO env)) env, HasLogFunc env) | |
=> [FilePath] | paths to template files |
-> RIO env (Map FileType TemplateType) | map of file types and templates |
Loads templates from the given paths.
:: 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
:: (Has CtHeaderFnConfigs env, Has CurrentYear env) | |
=> HeaderSyntax | syntax of the license header comments |
-> Variables | template variables |
-> Text | rendered 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:
- sanitize possibly corrupted comment syntax (
sanitizeSyntax
) - apply license header functions (
postProcessHeader
)