| Copyright | (c) 2019-2022 Vaclav Svejcar |
|---|---|
| License | BSD-3-Clause |
| Maintainer | vaclav.svejcar@gmail.com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Headroom.Command.Run
Contents
Description
Module representing the run command, the core command of Headroom, which is
responsible for license header management.
Synopsis
- commandRun :: CommandRunOptions -> IO ()
- loadTemplateRefs :: forall a env. (Template a, HasRIO Network env, HasRIO FileSystem env, HasLogFunc env) => [TemplateRef] -> RIO env (Map FileType a)
- typeOfTemplate :: HasLogFunc env => FilePath -> RIO env (Maybe FileType)
- postProcessHeader' :: forall a env. (Template a, Has CtPostProcessConfigs env, Has CurrentYear env) => HeaderSyntax -> Variables -> Text -> RIO env Text
Documentation
Arguments
| :: CommandRunOptions | Run command options |
| -> IO () | execution result |
Handler for Run command.
Arguments
| :: forall a env. (Template a, HasRIO Network env, HasRIO FileSystem 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).
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
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:
- sanitize possibly corrupted comment syntax (
sanitizeSyntax) - apply post-processors (
postProcessHeader)