headroom 0.3.1.0 → 0.3.2.0
raw patch · 24 files changed
+91/−88 lines, 24 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.Configuration 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.Configuration 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.HeaderConfig 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.HeaderConfig 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.HeaderFnConfigs 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.HeaderFnConfigs 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.HeadersConfig 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.HeadersConfig 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.UpdateCopyrightConfig 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (Headroom.Configuration.Types.UpdateCopyrightConfig 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (c 'Headroom.Configuration.Types.Complete) => GHC.Classes.Eq (Headroom.Configuration.Types.HeaderFnConfig 'Headroom.Configuration.Types.Complete c)
- Headroom.Configuration.Types: instance GHC.Classes.Eq (c 'Headroom.Configuration.Types.Partial) => GHC.Classes.Eq (Headroom.Configuration.Types.HeaderFnConfig 'Headroom.Configuration.Types.Partial c)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.Configuration 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.Configuration 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.HeaderConfig 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.HeaderConfig 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.HeaderFnConfigs 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.HeaderFnConfigs 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.HeadersConfig 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.HeadersConfig 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.UpdateCopyrightConfig 'Headroom.Configuration.Types.Complete)
- Headroom.Configuration.Types: instance GHC.Show.Show (Headroom.Configuration.Types.UpdateCopyrightConfig 'Headroom.Configuration.Types.Partial)
- Headroom.Configuration.Types: instance GHC.Show.Show (c 'Headroom.Configuration.Types.Complete) => GHC.Show.Show (Headroom.Configuration.Types.HeaderFnConfig 'Headroom.Configuration.Types.Complete c)
- Headroom.Configuration.Types: instance GHC.Show.Show (c 'Headroom.Configuration.Types.Partial) => GHC.Show.Show (Headroom.Configuration.Types.HeaderFnConfig 'Headroom.Configuration.Types.Partial c)
+ Headroom.Configuration.Types: instance GHC.Classes.Eq (c 'Headroom.Configuration.Types.Complete) => GHC.Classes.Eq (Headroom.Configuration.Types.CtHeaderFnConfig c)
+ Headroom.Configuration.Types: instance GHC.Classes.Eq (c 'Headroom.Configuration.Types.Partial) => GHC.Classes.Eq (Headroom.Configuration.Types.PtHeaderFnConfig c)
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.CtConfiguration
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.CtHeaderConfig
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.CtHeaderFnConfigs
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.CtHeadersConfig
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.CtUpdateCopyrightConfig
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.PtConfiguration
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.PtHeaderConfig
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.PtHeaderFnConfigs
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.PtHeadersConfig
+ Headroom.Configuration.Types: instance GHC.Classes.Eq Headroom.Configuration.Types.PtUpdateCopyrightConfig
+ Headroom.Configuration.Types: instance GHC.Show.Show (c 'Headroom.Configuration.Types.Complete) => GHC.Show.Show (Headroom.Configuration.Types.CtHeaderFnConfig c)
+ Headroom.Configuration.Types: instance GHC.Show.Show (c 'Headroom.Configuration.Types.Partial) => GHC.Show.Show (Headroom.Configuration.Types.PtHeaderFnConfig c)
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.CtConfiguration
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.CtHeaderConfig
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.CtHeaderFnConfigs
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.CtHeadersConfig
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.CtUpdateCopyrightConfig
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.PtConfiguration
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.PtHeaderConfig
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.PtHeaderFnConfigs
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.PtHeadersConfig
+ Headroom.Configuration.Types: instance GHC.Show.Show Headroom.Configuration.Types.PtUpdateCopyrightConfig
- Headroom.Command.Types: CommandInitOptions :: ![FilePath] -> !LicenseType -> CommandInitOptions
+ Headroom.Command.Types: CommandInitOptions :: [FilePath] -> LicenseType -> CommandInitOptions
- Headroom.Command.Types: CommandRunOptions :: !Maybe RunMode -> ![FilePath] -> ![Regex] -> !Maybe TemplateSource -> ![Text] -> !Bool -> !Bool -> CommandRunOptions
+ Headroom.Command.Types: CommandRunOptions :: Maybe RunMode -> [FilePath] -> [Regex] -> Maybe TemplateSource -> [Text] -> Bool -> Bool -> CommandRunOptions
- Headroom.Command.Types: [cioLicenseType] :: CommandInitOptions -> !LicenseType
+ Headroom.Command.Types: [cioLicenseType] :: CommandInitOptions -> LicenseType
- Headroom.Command.Types: [cioSourcePaths] :: CommandInitOptions -> ![FilePath]
+ Headroom.Command.Types: [cioSourcePaths] :: CommandInitOptions -> [FilePath]
- Headroom.Command.Types: [croDebug] :: CommandRunOptions -> !Bool
+ Headroom.Command.Types: [croDebug] :: CommandRunOptions -> Bool
- Headroom.Command.Types: [croDryRun] :: CommandRunOptions -> !Bool
+ Headroom.Command.Types: [croDryRun] :: CommandRunOptions -> Bool
- Headroom.Command.Types: [croExcludedPaths] :: CommandRunOptions -> ![Regex]
+ Headroom.Command.Types: [croExcludedPaths] :: CommandRunOptions -> [Regex]
- Headroom.Command.Types: [croRunMode] :: CommandRunOptions -> !Maybe RunMode
+ Headroom.Command.Types: [croRunMode] :: CommandRunOptions -> Maybe RunMode
- Headroom.Command.Types: [croSourcePaths] :: CommandRunOptions -> ![FilePath]
+ Headroom.Command.Types: [croSourcePaths] :: CommandRunOptions -> [FilePath]
- Headroom.Command.Types: [croTemplateSource] :: CommandRunOptions -> !Maybe TemplateSource
+ Headroom.Command.Types: [croTemplateSource] :: CommandRunOptions -> Maybe TemplateSource
- Headroom.Command.Types: [croVariables] :: CommandRunOptions -> ![Text]
+ Headroom.Command.Types: [croVariables] :: CommandRunOptions -> [Text]
- Headroom.Configuration.Types: Configuration :: (p ::: RunMode) -> (p ::: [FilePath]) -> (p ::: [Regex]) -> (p ::: TemplateSource) -> Variables -> HeadersConfig p -> HeaderFnConfigs p -> Configuration
+ Headroom.Configuration.Types: Configuration :: (p ::: RunMode) -> (p ::: [FilePath]) -> (p ::: [Regex]) -> (p ::: TemplateSource) -> Variables -> HeadersConfig p -> HeaderFnConfigs p -> Configuration (p :: Phase)
- Headroom.Configuration.Types: HeaderConfig :: (p ::: [Text]) -> (p ::: Int) -> (p ::: Int) -> (p ::: [Regex]) -> (p ::: [Regex]) -> (p ::: HeaderSyntax) -> HeaderConfig
+ Headroom.Configuration.Types: HeaderConfig :: (p ::: [Text]) -> (p ::: Int) -> (p ::: Int) -> (p ::: [Regex]) -> (p ::: [Regex]) -> (p ::: HeaderSyntax) -> HeaderConfig (p :: Phase)
- Headroom.Configuration.Types: HeaderFnConfig :: (p ::: Bool) -> c p -> HeaderFnConfig c
+ Headroom.Configuration.Types: HeaderFnConfig :: (p ::: Bool) -> c p -> HeaderFnConfig (p :: Phase) c
- Headroom.Configuration.Types: HeaderFnConfigs :: HeaderFnConfig p UpdateCopyrightConfig -> HeaderFnConfigs
+ Headroom.Configuration.Types: HeaderFnConfigs :: HeaderFnConfig p UpdateCopyrightConfig -> HeaderFnConfigs (p :: Phase)
- Headroom.Configuration.Types: HeadersConfig :: HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeadersConfig
+ Headroom.Configuration.Types: HeadersConfig :: HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeaderConfig p -> HeadersConfig (p :: Phase)
- Headroom.Configuration.Types: UpdateCopyrightConfig :: (p ::: Maybe (NonEmpty Text)) -> UpdateCopyrightConfig
+ Headroom.Configuration.Types: UpdateCopyrightConfig :: (p ::: Maybe (NonEmpty Text)) -> UpdateCopyrightConfig (p :: Phase)
- Headroom.Configuration.Types: [cExcludedPaths] :: Configuration -> p ::: [Regex]
+ Headroom.Configuration.Types: [cExcludedPaths] :: Configuration (p :: Phase) -> p ::: [Regex]
- Headroom.Configuration.Types: [cHeaderFnConfigs] :: Configuration -> HeaderFnConfigs p
+ Headroom.Configuration.Types: [cHeaderFnConfigs] :: Configuration (p :: Phase) -> HeaderFnConfigs p
- Headroom.Configuration.Types: [cLicenseHeaders] :: Configuration -> HeadersConfig p
+ Headroom.Configuration.Types: [cLicenseHeaders] :: Configuration (p :: Phase) -> HeadersConfig p
- Headroom.Configuration.Types: [cRunMode] :: Configuration -> p ::: RunMode
+ Headroom.Configuration.Types: [cRunMode] :: Configuration (p :: Phase) -> p ::: RunMode
- Headroom.Configuration.Types: [cSourcePaths] :: Configuration -> p ::: [FilePath]
+ Headroom.Configuration.Types: [cSourcePaths] :: Configuration (p :: Phase) -> p ::: [FilePath]
- Headroom.Configuration.Types: [cTemplateSource] :: Configuration -> p ::: TemplateSource
+ Headroom.Configuration.Types: [cTemplateSource] :: Configuration (p :: Phase) -> p ::: TemplateSource
- Headroom.Configuration.Types: [cVariables] :: Configuration -> Variables
+ Headroom.Configuration.Types: [cVariables] :: Configuration (p :: Phase) -> Variables
- Headroom.Configuration.Types: [hcFileExtensions] :: HeaderConfig -> p ::: [Text]
+ Headroom.Configuration.Types: [hcFileExtensions] :: HeaderConfig (p :: Phase) -> p ::: [Text]
- Headroom.Configuration.Types: [hcHeaderSyntax] :: HeaderConfig -> p ::: HeaderSyntax
+ Headroom.Configuration.Types: [hcHeaderSyntax] :: HeaderConfig (p :: Phase) -> p ::: HeaderSyntax
- Headroom.Configuration.Types: [hcMarginAfter] :: HeaderConfig -> p ::: Int
+ Headroom.Configuration.Types: [hcMarginAfter] :: HeaderConfig (p :: Phase) -> p ::: Int
- Headroom.Configuration.Types: [hcMarginBefore] :: HeaderConfig -> p ::: Int
+ Headroom.Configuration.Types: [hcMarginBefore] :: HeaderConfig (p :: Phase) -> p ::: Int
- Headroom.Configuration.Types: [hcPutAfter] :: HeaderConfig -> p ::: [Regex]
+ Headroom.Configuration.Types: [hcPutAfter] :: HeaderConfig (p :: Phase) -> p ::: [Regex]
- Headroom.Configuration.Types: [hcPutBefore] :: HeaderConfig -> p ::: [Regex]
+ Headroom.Configuration.Types: [hcPutBefore] :: HeaderConfig (p :: Phase) -> p ::: [Regex]
- Headroom.Configuration.Types: [hfcConfig] :: HeaderFnConfig c -> c p
+ Headroom.Configuration.Types: [hfcConfig] :: HeaderFnConfig (p :: Phase) c -> c p
- Headroom.Configuration.Types: [hfcEnabled] :: HeaderFnConfig c -> p ::: Bool
+ Headroom.Configuration.Types: [hfcEnabled] :: HeaderFnConfig (p :: Phase) c -> p ::: Bool
- Headroom.Configuration.Types: [hfcsUpdateCopyright] :: HeaderFnConfigs -> HeaderFnConfig p UpdateCopyrightConfig
+ Headroom.Configuration.Types: [hfcsUpdateCopyright] :: HeaderFnConfigs (p :: Phase) -> HeaderFnConfig p UpdateCopyrightConfig
- Headroom.Configuration.Types: [hscC] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscC] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscCpp] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscCpp] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscCss] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscCss] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscHaskell] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscHaskell] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscHtml] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscHtml] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscJava] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscJava] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscJs] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscJs] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscPureScript] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscPureScript] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscRust] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscRust] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscScala] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscScala] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [hscShell] :: HeadersConfig -> HeaderConfig p
+ Headroom.Configuration.Types: [hscShell] :: HeadersConfig (p :: Phase) -> HeaderConfig p
- Headroom.Configuration.Types: [uccSelectedAuthors] :: UpdateCopyrightConfig -> p ::: Maybe (NonEmpty Text)
+ Headroom.Configuration.Types: [uccSelectedAuthors] :: UpdateCopyrightConfig (p :: Phase) -> p ::: Maybe (NonEmpty Text)
- Headroom.Configuration.Types: type CtConfiguration = Configuration 'Complete
+ Headroom.Configuration.Types: type CtConfiguration = Configuration 'Complete
- Headroom.Configuration.Types: type CtHeaderConfig = HeaderConfig 'Complete
+ Headroom.Configuration.Types: type CtHeaderConfig = HeaderConfig 'Complete
- Headroom.Configuration.Types: type CtHeaderFnConfig c = HeaderFnConfig 'Complete c
+ Headroom.Configuration.Types: type CtHeaderFnConfig c = HeaderFnConfig 'Complete c
- Headroom.Configuration.Types: type CtHeaderFnConfigs = HeaderFnConfigs 'Complete
+ Headroom.Configuration.Types: type CtHeaderFnConfigs = HeaderFnConfigs 'Complete
- Headroom.Configuration.Types: type CtHeadersConfig = HeadersConfig 'Complete
+ Headroom.Configuration.Types: type CtHeadersConfig = HeadersConfig 'Complete
- Headroom.Configuration.Types: type CtUpdateCopyrightConfig = UpdateCopyrightConfig 'Complete
+ Headroom.Configuration.Types: type CtUpdateCopyrightConfig = UpdateCopyrightConfig 'Complete
- Headroom.Configuration.Types: type PtConfiguration = Configuration 'Partial
+ Headroom.Configuration.Types: type PtConfiguration = Configuration 'Partial
- Headroom.Configuration.Types: type PtHeaderConfig = HeaderConfig 'Partial
+ Headroom.Configuration.Types: type PtHeaderConfig = HeaderConfig 'Partial
- Headroom.Configuration.Types: type PtHeaderFnConfig c = HeaderFnConfig 'Partial c
+ Headroom.Configuration.Types: type PtHeaderFnConfig c = HeaderFnConfig 'Partial c
- Headroom.Configuration.Types: type PtHeaderFnConfigs = HeaderFnConfigs 'Partial
+ Headroom.Configuration.Types: type PtHeaderFnConfigs = HeaderFnConfigs 'Partial
- Headroom.Configuration.Types: type PtHeadersConfig = HeadersConfig 'Partial
+ Headroom.Configuration.Types: type PtHeadersConfig = HeadersConfig 'Partial
- Headroom.Configuration.Types: type PtUpdateCopyrightConfig = UpdateCopyrightConfig 'Partial
+ Headroom.Configuration.Types: type PtUpdateCopyrightConfig = UpdateCopyrightConfig 'Partial
- Headroom.Data.Regex: CompilationFailed :: !Text -> !Text -> RegexError
+ Headroom.Data.Regex: CompilationFailed :: Text -> Text -> RegexError
- Headroom.FileSupport.Types: FileInfo :: !FileType -> !CtHeaderConfig -> !Maybe (Int, Int) -> !Variables -> FileInfo
+ Headroom.FileSupport.Types: FileInfo :: FileType -> CtHeaderConfig -> Maybe (Int, Int) -> Variables -> FileInfo
- Headroom.FileSupport.Types: [fiFileType] :: FileInfo -> !FileType
+ Headroom.FileSupport.Types: [fiFileType] :: FileInfo -> FileType
- Headroom.FileSupport.Types: [fiHeaderConfig] :: FileInfo -> !CtHeaderConfig
+ Headroom.FileSupport.Types: [fiHeaderConfig] :: FileInfo -> CtHeaderConfig
- Headroom.FileSupport.Types: [fiHeaderPos] :: FileInfo -> !Maybe (Int, Int)
+ Headroom.FileSupport.Types: [fiHeaderPos] :: FileInfo -> Maybe (Int, Int)
- Headroom.FileSupport.Types: [fiVariables] :: FileInfo -> !Variables
+ Headroom.FileSupport.Types: [fiVariables] :: FileInfo -> Variables
- Headroom.HeaderFn.UpdateCopyright: UpdateSelectedAuthors :: !SelectedAuthors -> UpdateCopyrightMode
+ Headroom.HeaderFn.UpdateCopyright: UpdateSelectedAuthors :: SelectedAuthors -> UpdateCopyrightMode
- Headroom.Template: MissingVariables :: !Text -> ![Text] -> TemplateError
+ Headroom.Template: MissingVariables :: Text -> [Text] -> TemplateError
- Headroom.Template: ParseError :: !Text -> TemplateError
+ Headroom.Template: ParseError :: Text -> TemplateError
- Headroom.Types: HaddockFieldOffsets :: !Maybe Int -> HaddockFieldOffsets
+ Headroom.Types: HaddockFieldOffsets :: Maybe Int -> HaddockFieldOffsets
- Headroom.Types: HaskellTemplateMeta :: !HaddockFieldOffsets -> TemplateMeta
+ Headroom.Types: HaskellTemplateMeta :: HaddockFieldOffsets -> TemplateMeta
- Headroom.Types: [hfoCopyright] :: HaddockFieldOffsets -> !Maybe Int
+ Headroom.Types: [hfoCopyright] :: HaddockFieldOffsets -> Maybe Int
- Headroom.UI.Progress: Progress :: !Int -> !Int -> Progress
+ Headroom.UI.Progress: Progress :: Int -> Int -> Progress
Files
- CHANGELOG.md +5/−0
- README.md +0/−0
- headroom.cabal +4/−3
- src/Headroom/Command/Init.hs +1/−1
- src/Headroom/Command/Types.hs +10/−9
- src/Headroom/Data/Regex.hs +2/−1
- src/Headroom/FileSupport.hs +1/−1
- src/Headroom/FileSupport/Types.hs +5/−4
- src/Headroom/HeaderFn/UpdateCopyright.hs +2/−1
- src/Headroom/Template.hs +3/−2
- src/Headroom/Types.hs +3/−2
- src/Headroom/UI/Progress.hs +2/−1
- src/Headroom/Variables.hs +2/−1
- test/Headroom/Command/InitSpec.hs +5/−4
- test/Headroom/Command/RunSpec.hs +3/−4
- test/Headroom/Ext/Haskell/HaddockSpec.hs +1/−0
- test/Headroom/FileSystemSpec.hs +23/−16
- test/Headroom/HeaderFn/TypesSpec.hs +9/−8
- test/Headroom/HeaderFn/UpdateCopyrightSpec.hs +3/−2
- test/Headroom/HeaderFnSpec.hs +1/−2
- test/Headroom/Template/MustacheSpec.hs +3/−5
- test/Headroom/UI/ProgressSpec.hs +1/−2
- test/Headroom/VariablesSpec.hs +2/−4
- test/Test/Utils.hs +0/−15
CHANGELOG.md view
@@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## 0.3.2.0 (released 2020-11-26)+- [#56] Move CI from Travis to GitHub Actions+- Minor improvements & bugfixes+- Bump _LTS Haskell_ to `16.23`+ ## 0.3.1.0 (released 2020-08-18) - [#48] Decouple IO actions for easier testing - [#53] Add support for _PureScript_ source code files
README.md view
headroom.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: f49109b0113a73a61d4c99db85698fd193e3cbc6ffd87671cebaed06bcaa61f4+-- hash: 3ad29fd26d8cdd22903560fba5cdce69121c53c5065bb10a4a63978bc1d139a7 name: headroom-version: 0.3.1.0+version: 0.3.2.0 synopsis: License Header Manager description: Would you like to have nice, up-to-date license/copyright headers in your source code files but hate to manage them by hand? Then Headroom is the right tool for you! Now you can define your license header as Mustache template, put all the variables (such as author's name, year, etc.) into the YAML config file and Headroom will take care to add such license headers to all your source code files. category: Utils@@ -245,11 +245,12 @@ Headroom.TypesSpec Headroom.UI.ProgressSpec Headroom.VariablesSpec- Test.Utils Paths_headroom hs-source-dirs: test ghc-options: -optP-Wno-nonportable-include-path -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints -Werror=incomplete-patterns+ build-tool-depends:+ hspec-discover:hspec-discover build-depends: QuickCheck , aeson
src/Headroom/Command/Init.hs view
@@ -220,7 +220,7 @@ -- | Exception specific to the "Headroom.Command.Init" module data CommandInitError- = AppConfigAlreadyExists !FilePath+ = AppConfigAlreadyExists FilePath -- ^ application configuration file already exists | NoProvidedSourcePaths -- ^ no paths to source code files provided
src/Headroom/Command/Types.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE StrictData #-} {-| Module : Headroom.Command.Types@@ -50,28 +51,28 @@ -- | Options for the @init@ command. data CommandInitOptions = CommandInitOptions- { cioSourcePaths :: ![FilePath]+ { cioSourcePaths :: [FilePath] -- ^ paths to source code files- , cioLicenseType :: !LicenseType+ , cioLicenseType :: LicenseType -- ^ license type } deriving Show -- | Options for the @run@ command. data CommandRunOptions = CommandRunOptions- { croRunMode :: !(Maybe RunMode)+ { croRunMode :: Maybe RunMode -- ^ used /Run/ command mode- , croSourcePaths :: ![FilePath]+ , croSourcePaths :: [FilePath] -- ^ source code file paths- , croExcludedPaths :: ![Regex]+ , croExcludedPaths :: [Regex] -- ^ source paths to exclude- , croTemplateSource :: !(Maybe TemplateSource)+ , croTemplateSource :: Maybe TemplateSource -- ^ source of license templates- , croVariables :: ![Text]+ , croVariables :: [Text] -- ^ raw variables- , croDebug :: !Bool+ , croDebug :: Bool -- ^ whether to run in debug mode- , croDryRun :: !Bool+ , croDryRun :: Bool -- ^ whether to perform dry run } deriving (Eq, Show)
src/Headroom/Data/Regex.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE StrictData #-} {-# LANGUAGE TemplateHaskell #-} {-|@@ -135,7 +136,7 @@ --------------------------------- Error Types -------------------------------- -- | Exception specific to the "Headroom.Data.Regex" module.-data RegexError = CompilationFailed !Text !Text+data RegexError = CompilationFailed Text Text -- ^ given input cannot be compiled as /regex/ deriving (Show, Typeable)
src/Headroom/FileSupport.hs view
@@ -71,7 +71,7 @@ extractFileInfo fiFileType fiHeaderConfig meta text = let fiHeaderPos = findHeader fiHeaderConfig text fiVariables =- extractVariables fiFileType fiHeaderConfig meta fiHeaderPos text+ extractVariables fiFileType fiHeaderConfig meta fiHeaderPos text in FileInfo { .. }
src/Headroom/FileSupport/Types.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE StrictData #-} {-| Module : Headroom.FileSupport.Types@@ -26,13 +27,13 @@ -- | Info extracted about the concrete source code file. data FileInfo = FileInfo- { fiFileType :: !FileType+ { fiFileType :: FileType -- ^ type of the file- , fiHeaderConfig :: !CtHeaderConfig+ , fiHeaderConfig :: CtHeaderConfig -- ^ configuration for license header- , fiHeaderPos :: !(Maybe (Int, Int))+ , fiHeaderPos :: Maybe (Int, Int) -- ^ position of existing license header- , fiVariables :: !Variables+ , fiVariables :: Variables -- ^ additional extracted variables } deriving (Eq, Show)
src/Headroom/HeaderFn/UpdateCopyright.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE StrictData #-} {-# LANGUAGE TypeApplications #-} {-|@@ -53,7 +54,7 @@ data UpdateCopyrightMode = UpdateAllAuthors -- ^ updates years in copyrights for all authors- | UpdateSelectedAuthors !SelectedAuthors+ | UpdateSelectedAuthors SelectedAuthors -- ^ updates years in copyrights only for selected authors deriving (Eq, Show)
src/Headroom/Template.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE StrictData #-} {-| Module : Headroom.Template@@ -71,9 +72,9 @@ -- | Error during processing template. data TemplateError- = MissingVariables !Text ![Text]+ = MissingVariables Text [Text] -- ^ missing variable values- | ParseError !Text+ | ParseError Text -- ^ error parsing raw template text deriving (Eq, Show, Typeable)
src/Headroom/Types.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE StrictData #-} {-| Module : Headroom.Types@@ -72,7 +73,7 @@ -- | Offsets for selected fields extracted from /Haddock module header/. data HaddockFieldOffsets = HaddockFieldOffsets- { hfoCopyright :: !(Maybe Int)+ { hfoCopyright :: Maybe Int -- ^ offset for /Copyright/ field } deriving (Eq, Show)@@ -81,6 +82,6 @@ def = HaddockFieldOffsets { hfoCopyright = Nothing } -- | Metadata parsed from raw /template/, specific for selected /file type/.-data TemplateMeta = HaskellTemplateMeta !HaddockFieldOffsets+data TemplateMeta = HaskellTemplateMeta HaddockFieldOffsets deriving (Eq, Show)
src/Headroom/UI/Progress.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE StrictData #-} {-| Module : Headroom.UI.Progress@@ -26,7 +27,7 @@ -- | Progress indication. First argument is current progress, second the maximum -- value.-data Progress = Progress !Int !Int+data Progress = Progress Int Int deriving (Eq, Show)
src/Headroom/Variables.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE StrictData #-} {-# LANGUAGE TypeApplications #-} {-|@@ -101,7 +102,7 @@ --------------------------------- Error Types -------------------------------- -- | Exception specific to the "Headroom.Variables" module.-data VariablesError = InvalidVariable !Text+data VariablesError = InvalidVariable Text -- ^ invalid variable input (as @key=value@) deriving (Eq, Show)
test/Headroom/Command/InitSpec.hs view
@@ -51,17 +51,18 @@ spec :: Spec spec = do+ describe "doesAppConfigExist" $ do it "checks that configuration file exists in selected directory" $ do let env' = env & envFileSystemL . fsDoesFileExistL .~ check check path = pure $ env' ^. envPathsL . pConfigFileL == path- result <- runRIO env' doesAppConfigExist- result `shouldBe` True+ runRIO env' doesAppConfigExist `shouldReturn` True + describe "findSupportedFileTypes" $ do it "recursively finds all known file types present in given path" $ do- result <- runRIO env findSupportedFileTypes- L.sort result `shouldBe` L.sort [HTML]+ L.sort <$> runRIO env findSupportedFileTypes `shouldReturn` [HTML]+ env :: TestEnv env = TestEnv { .. }
test/Headroom/Command/RunSpec.hs view
@@ -70,8 +70,7 @@ spec = do describe "loadBuiltInTemplates" $ do it "should load correct number of built-in templates" $ do- templates <- runRIO env $ loadBuiltInTemplates BSD3- M.size templates `shouldBe` 11+ M.size <$> runRIO env (loadBuiltInTemplates BSD3) `shouldReturn` 11 describe "loadTemplateFiles" $ do@@ -113,8 +112,8 @@ ] vars = mkVariables [("sndAuthor", "2nd Author")] syntax = LineComment "--"- actual <- runRIO env $ postProcessHeader' syntax vars sample- actual `shouldBe` expected+ runRIO env (postProcessHeader' syntax vars sample) `shouldReturn` expected+ describe "sanitizeHeader" $ do it "does nothing when block comment syntax used" $ do
test/Headroom/Ext/Haskell/HaddockSpec.hs view
@@ -30,6 +30,7 @@ let expected = HaddockFieldOffsets { hfoCopyright = Just 14 } extractFieldOffsets template `shouldBe` expected + describe "extractModuleHeader" $ do it "extracts fields from Haddock module header" $ do let
test/Headroom/FileSystemSpec.hs view
@@ -9,6 +9,7 @@ import Headroom.Data.Regex ( re ) import Headroom.FileSystem import RIO+import RIO.FilePath ( (</>) ) import RIO.List ( sort ) import qualified RIO.List as L import Test.Hspec@@ -19,36 +20,42 @@ describe "fileExtension" $ do it "returns file extension for valid file path" $ do fileExtension "/some/path/to/file.txt" `shouldBe` Just "txt"+ it "returns nothing for invalid file path" $ do fileExtension "/some/nonsense/path" `shouldBe` Nothing + describe "findFiles" $ do it "recursively finds files filtered by given predicate" $ do- files <- findFiles "test-data/test-traverse/" ("b.html" `L.isSuffixOf`)- let expected = ["test-data/test-traverse/foo/b.html"]- files `shouldBe` expected+ let path = "test-data" </> "test-traverse"+ predicate = ("b.html" `L.isSuffixOf`)+ expected = ["test-data" </> "test-traverse" </> "foo" </> "b.html"]+ sort <$> findFiles path predicate `shouldReturn` sort expected + describe "findFilesByExts" $ do it "recursively finds files filtered by its file extension" $ do- files <- findFilesByExts "test-data/test-traverse/" ["xml"]- let expected = ["test-data/test-traverse/foo/test.xml"]- files `shouldBe` expected+ let path = "test-data" </> "test-traverse"+ exts = ["xml"]+ expected = ["test-data" </> "test-traverse" </> "foo" </> "test.xml"]+ sort <$> findFilesByExts path exts `shouldReturn` sort expected + describe "listFiles" $ do it "recursively finds all files in directory" $ do- filePaths <- listFiles "test-data/test-traverse/"- let expected =- [ "test-data/test-traverse/a.html"- , "test-data/test-traverse/foo/b.html"- , "test-data/test-traverse/foo/test.xml"- , "test-data/test-traverse/foo/bar/c.html"+ let path = "test-data" </> "test-traverse"+ expected =+ [ "test-data" </> "test-traverse" </> "a.html"+ , "test-data" </> "test-traverse" </> "foo" </> "b.html"+ , "test-data" </> "test-traverse" </> "foo" </> "test.xml"+ , "test-data" </> "test-traverse" </> "foo" </> "bar" </> "c.html" ]- sort filePaths `shouldBe` sort expected+ sort <$> listFiles path `shouldReturn` sort expected it "returns file if file path is passed as argument" $ do- filePaths <- listFiles "test-data/test-traverse/a.html"- let expected = ["test-data/test-traverse/a.html"]- sort filePaths `shouldBe` sort expected+ let path = "test-data" </> "test-traverse" </> "a.html"+ sort <$> listFiles path `shouldReturn` [path]+ describe "excludePaths" $ do it "excludes paths matching selected pattern from input list" $ do
test/Headroom/HeaderFn/TypesSpec.hs view
@@ -3,6 +3,7 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-} module Headroom.HeaderFn.TypesSpec ( spec )@@ -17,6 +18,7 @@ spec :: Spec spec = do+ describe "Semigroup HeaderFn" $ do it "combines two values together" $ do let fooEnv = FooEnv "_FOO_ENV"@@ -25,32 +27,31 @@ input = "input" combinedFn = fooFn <> barFn expected = "input_FOO_ENV_BAR_ENV"- actual = runHeaderFn combinedFn combinedEnv input- actual `shouldBe` expected+ runHeaderFn combinedFn combinedEnv input `shouldBe` expected + describe "Monoid HeaderFn" $ do it "does nothing with the input" $ do let input = "input" testEnv = undefined testFn = mempty- actual = runHeaderFn testFn testEnv input- actual `shouldBe` input+ runHeaderFn testFn testEnv input `shouldBe` input ------------------------------- Test Data Types ------------------------------ data FooEnv = FooEnv- { feValue :: !Text+ { feValue :: Text } data BarEnv = BarEnv- { beValue :: !Text+ { beValue :: Text } data CombinedEnv = CombinedEnv- { ceFooEnv :: !FooEnv- , ceBarEnv :: !BarEnv+ { ceFooEnv :: FooEnv+ , ceBarEnv :: BarEnv }
test/Headroom/HeaderFn/UpdateCopyrightSpec.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE StrictData #-} module Headroom.HeaderFn.UpdateCopyrightSpec ( spec )@@ -88,8 +89,8 @@ data TestEnv = TestEnv- { teCurrentYear :: !CurrentYear- , teMode :: !UpdateCopyrightMode+ { teCurrentYear :: CurrentYear+ , teMode :: UpdateCopyrightMode } deriving (Eq, Show)
test/Headroom/HeaderFnSpec.hs view
@@ -48,9 +48,8 @@ it "executes the function for given environment" $ do let testEnv = TestEnv "ENV" input = "input"- actual = runHeaderFn testFn testEnv input expected = "input_ENV"- actual `shouldBe` expected+ runHeaderFn testFn testEnv input `shouldBe` expected describe "postProcessHeader" $ do
test/Headroom/Template/MustacheSpec.hs view
@@ -12,7 +12,6 @@ import Headroom.Variables ( mkVariables ) import RIO import Test.Hspec-import Test.Utils ( matchesException ) spec :: Spec@@ -36,10 +35,9 @@ let template = "Hello, {{ name }} {{ surname }}" variables = mkVariables [("name", "John")] parsed = parseTemplate @Mustache (Just "test") template- rendered = parsed >>= renderTemplate variables- check (Just (MissingVariables "test" ["surname"])) = True- check _ = False- rendered `shouldSatisfy` matchesException check+ let err (MissingVariables "test" ["surname"]) = True+ err _ = False+ (parsed >>= renderTemplate variables) `shouldThrow` err it "renders template with conditionally set variable" $ do let template = "Foo {{#bar}}{{bar}}{{/bar}}{{^bar}}BAR{{/bar}}"
test/Headroom/UI/ProgressSpec.hs view
@@ -14,9 +14,8 @@ describe "zipWithProgress" $ do it "zips progress for given collection" $ do let col = ["a", "b"] :: [Text]- actual = zipWithProgress col expected = [(Progress 1 2, "a"), (Progress 2 2, "b")]- actual `shouldBe` expected+ zipWithProgress col `shouldBe` expected describe "show" $ do it "displays correct output for Progress data type" $ do
test/Headroom/VariablesSpec.hs view
@@ -35,14 +35,12 @@ [("name", "John Smith"), ("greeting", "Hello, {{ name }}")] expected = mkVariables [("name", "John Smith"), ("greeting", "Hello, John Smith")]- result <- compileVariables sample1- result `shouldBe` expected+ compileVariables sample1 `shouldReturn` expected it "doesn't get stuck in infinite loop on invalid recursive variable" $ do let sample1 = mkVariables [("greeting", "Hello, {{ greeting }}")] expected = mkVariables [("greeting", "Hello, Hello, {{ greeting }}")]- result <- compileVariables sample1- result `shouldBe` expected+ compileVariables sample1 `shouldReturn` expected describe "dynamicVariables" $ do
− test/Test/Utils.hs
@@ -1,15 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-}-module Test.Utils- ( matchesException- )-where--import RIO--matchesException :: Exception e- => (Maybe e -> Bool)- -> Either SomeException r- -> Bool-matchesException cond (Left ex) | cond (fromException ex) = True- | otherwise = False-matchesException _ _ = False