packages feed

templatise 0.1.3.0 → 0.1.4.0

raw patch · 5 files changed

+126/−112 lines, 5 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -2,6 +2,18 @@  ## unreleased +## 0.1.4.0 -- 2024-06-01++### Added++* Test GHC 9.10+* Support for base 4.20+* vale linting for documentation++### Deprecated++* Test GHC 9.4+ ## 0.1.3.0 -- 2024-05-25  ### Added
README.md view
@@ -1,4 +1,6 @@+<!-- vale RedHat.Headings = NO --> # template.hs+<!-- vale RedHat.Headings = YES -->  [Homepage][repository] @@ -6,28 +8,29 @@  ## Description -You can use template.hs to create a new GitHub repository. The repository will-have Haskell, VS Code devcontainers, and various GitHub actions ready to use.+You can use template.hs to create a new GitHub repository. The new repository+has Haskell, Visual Studio Code Dev Containers, and various GitHub actions+ready to use.  ## Terms of use  You are free to use template.hs as a basis for your own projects without any-conditions.  See the [LICENSE] file for details.+conditions. See the [LICENSE] file for details.  ## Prerequisites -1. VS Code with "Remote Development" installed+1. Visual Studio Code with "Remote Development" installed  ## How to use this template  1. Visit [the repository][repository] 1. Click "Use this template" 1. Follow the GitHub Docs to [Create a repo][create a repo]-1. Open VS Code-1. Open the command prompt (ctrl+shift+p)-1. Type "clone repository in container" and hit return+1. Open Visual Studio Code+1. Open the shell prompt (Ctrl+shift+p)+1. Type "clone repository in container" and press return 1. Input the GitHub URL of your new repository-1. In the resulting terminal (ctrl+\`), run: `cabal run initialise`+1. In the resulting terminal (Ctrl+\`), run: `cabal run initialise` 1. Browse to "Setting" -> "Actions" -> "General" 1. Tick "Allow GitHub Actions to create and approve pull requests" 1. Continue working on your awesome project@@ -36,11 +39,11 @@  * [LICENSE]: The license governing use of template.hs -## Getting Help+## Getting help  * [GitHub Issues][issues]: Support requests, bug reports, and feature requests -## How to Help+## How to help  * Submit [issues] for problems or questions * Submit [pull requests] for proposed changes
lib/initialise/Cabal.hs view
@@ -8,7 +8,6 @@ module Cabal (replace, convert) where  import Configuration (Configuration (..))-import Control.Exception (Exception) import Control.Monad.Catch (throwM) import Control.Monad.Logger (logInfo) import Control.Monad.Reader (MonadReader (ask), asks, liftIO)@@ -37,6 +36,7 @@ import Prelude hiding (concat, readFile, unlines, writeFile)  #if __GLASGOW_HASKELL__ < 908+import Control.Exception (Exception) import Text.Parsec.Error (ParseError) instance Exception ParseError #endif
lib/initialise/Configuration.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE ApplicativeDo #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} @@ -15,9 +16,7 @@ import Distribution.SPDX.LicenseId (LicenseId (Unlicense)) import Network.URI (URI, parseURI) import Options.Applicative-  ( HasValue,-    Mod,-    Parser,+  ( Parser,     auto,     help,     hidden,@@ -44,97 +43,91 @@   }  parser :: Defaults -> Parser Configuration-parser ds@(Defaults {..}) =-  Configuration-    <$> name-    <*> cabalName-    <*> homepage-    <*> author-    <*> maintainer-    <*> licence-    <*> path-    <*> year-    <*> verbosity+parser ds@(Defaults {..}) = do+  name <-+    strOption+      ( long "name"+          <> help "Name of the new project."+          <> metavar+            "NAME"+          <> maybeDefault (dName ds)+      )+  cabalName <-+    strOption+      ( long "cabal-name"+          <> help "Name to use in cabal."+          <> metavar "CABAL_NAME"+          <> maybeDefault (dCabalName ds)+      )+  homepage <-+    option+      (maybeReader parseURI)+      ( long "homepage"+          <> help+            "Homepage of the new project."+          <> metavar "URL"+          <> maybeDefault (dHomePage ds)+      )+  author <-+    strOption+      ( long "author"+          <> help "Name of the author of the project."+          <> metavar "AUTHOR"+          <> value dAuthor+          <> showDefault+      )+  maintainer <-+    strOption+      ( long "maintainer"+          <> help+            "Email of the maintainer of the project."+          <> metavar "MAINTAINER"+          <> value dMaintainer+          <> showDefault+      )+  licence <-+    option+      auto+      ( long "licence"+          <> help "Licence of the project."+          <> value Unlicense+          <> showDefault+          <> metavar "LICENCE"+      )+  path <-+    option+      auto+      ( long "path"+          <> help "Project path.  Only used for testing."+          <> value dPath+          <> showDefault+          <> metavar "PATH"+          <> hidden+          <> internal+      )+  year <-+    option+      auto+      ( long "year"+          <> help "Copyright year.  Only used for testing."+          <> value dYear+          <> showDefault+          <> metavar "YEAR"+          <> hidden+          <> internal+      )+  verbosity <-+    option+      auto+      ( long "verbosity"+          <> help+            "Verbosity of information printed to stderr."+          <> value LevelWarn+          <> showDefault+          <> metavar "VERBOSITY"+      )+  pure Configuration {..}   where-    name =-      strOption-        ( long "name"-            <> help "Name of the new project."-            <> metavar "NAME"-            <> maybeDefault (dName ds)-        )-    cabalName =-      strOption-        ( long "cabal-name"-            <> help "Name to use in cabal."-            <> metavar "CABAL_NAME"-            <> maybeDefault (dCabalName ds)-        )-    homepage =-      option-        (maybeReader parseURI)-        ( long "homepage"-            <> help "Homepage of the new project."-            <> metavar "URL"-            <> maybeDefault (dHomePage ds)-        )-    author =-      strOption-        ( long "author"-            <> help "Name of the author of the project."-            <> metavar "AUTHOR"-            <> value dAuthor-            <> showDefault-        )-    maintainer =-      strOption-        ( long "maintainer"-            <> help "Email of the maintainer of the project."-            <> metavar "MAINTAINER"-            <> value dMaintainer-            <> showDefault-        )-    licence =-      option-        auto-        ( long "licence"-            <> help "Licence of the project."-            <> value Unlicense-            <> showDefault-            <> metavar "LICENCE"-        )-    path =-      option-        auto-        ( long "path"-            <> help "Project path.  Only used for testing."-            <> value dPath-            <> showDefault-            <> metavar "PATH"-            <> hidden-            <> internal-        )-    year =-      option-        auto-        ( long "year"-            <> help "Copyright year.  Only used for testing."-            <> value dYear-            <> showDefault-            <> metavar "YEAR"-            <> hidden-            <> internal-        )-    verbosity =-      option-        auto-        ( long "verbosity"-            <> help "Verbosity of information printed to stderr."-            <> value LevelWarn-            <> showDefault-            <> metavar "VERBOSITY"-        )--maybeDefault :: (HasValue f, Show a) => Maybe a -> Mod f a-maybeDefault (Just a) = value a <> showDefault-maybeDefault Nothing = mempty+    -- maybeDefault :: (HasValue f, Show a) => Maybe a -> Mod f a+    maybeDefault (Just a) = value a <> showDefault+    maybeDefault Nothing = mempty
templatise.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               templatise-version:            0.1.3.0+version:            0.1.4.0 license:            Unlicense license-file:       LICENSE copyright:          (c) 2023 Alex Brandt@@ -17,7 +17,9 @@   have Haskell, VS Code devcontainers, and various GitHub actions ready to use.  category:           VSCode-tested-with:        GHC >=9.4 && <9.5 || >=9.6 && <9.7 || >=9.8 && <9.9+tested-with:+  GHC >=9.4 && <9.5 || >=9.6 && <9.7 || >=9.8 && <9.9 || >=9.10 && <9.11+ extra-source-files:   .devcontainer/devcontainer.json   .github/workflows/*.yml@@ -36,7 +38,7 @@  common initialise-common   build-depends:-    , base                  >=4.16.3.0  && <4.20+    , base                  ^>=4.16.3.0 || ^>=4.17     || ^>=4.18     || ^>=4.19 || ^>=4.20     , bytestring            ^>=0.11.3.1 || ^>=0.12.0.2     , Cabal-syntax          ^>=3.8.1.0  || ^>=3.10.1.0 || ^>=3.12.0.0     , filepath              >=1.4.2.2   && <1.6@@ -49,6 +51,10 @@     , text                  ^>=1.2.5.0  || ^>=2.0.1    || ^>=2.1     , time                  ^>=1.11.1.1 || ^>=1.12.2   || ^>=1.13     || ^>=1.14 +  ghc-options:+    -Wall -Werror=missing-fields -Werror=unused-imports+    -Werror=unused-matches -Werror=unused-top-binds+ library initialise-library   import:           initialise-common   exposed-modules:@@ -78,8 +84,8 @@   --other-extensions:   default-language: Haskell2010 -  --build-tool-depends:-  ghc-options:      -Wall+--build-tool-depends:+--ghc-options:      -Wall  test-suite initialise-test   import:           initialise-common