Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile against newer dependencies #295

Merged
merged 8 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ jobs:
- uses: actions/checkout@v4
- id: stack
uses: freckle/stack-action@v5
- uses: freckle/weeder-action@v2
with:
ghc-version: ${{ steps.stack.outputs.compiler-version }}

# https://github.com/ocharles/weeder/issues/190
# - uses: freckle/weeder-action@v2
# with:
# ghc-version: ${{ steps.stack.outputs.compiler-version }}

- uses: extractions/setup-just@v2
- run: just dist
- uses: actions/upload-artifact@v4
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
needs: [build]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/download-artifact@v4

- id: token
Expand All @@ -51,13 +54,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}

# - if: ${{ steps.release.outputs.new_release_published == 'true' }}
# run: |
# gh release upload "$TAG" ./*-binaries/restyler-*.tar.gz
# env:
# TAG: ${{ steps.release.outputs.new_release_git_tag }}
# GH_TOKEN: ${{ github.token }}

docs:
needs: [build]
environment:
Expand All @@ -83,8 +79,10 @@ jobs:
mkdir -p ./bin
sudo mv -v restyler-*/restyle /usr/local/bin

# TODO: only checkout doc folder
- uses: actions/checkout@v4
with:
sparse-checkout: |
doc

- name: Generate ronn documenation
run: |
Expand Down
2 changes: 1 addition & 1 deletion app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Main
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
17 changes: 15 additions & 2 deletions fourmolu.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
indentation: 2
column-limit: 80 # ignored until v12 / ghc-9.6
column-limit: 80
function-arrows: leading
comma-style: leading # default
import-export-style: leading
import-grouping:
- name: "Preludes"
rules:
- glob: Prelude
- glob: Restyler.Prelude
- name: "Everything else"
rules:
- match: all
priority: 100
indent-wheres: false # default
record-brace-space: true
newlines-between-decls: 1 # default
haddock-style: single-line
let-style: mixed
in-style: left-align
single-constraint-parens: never # ignored until v12 / ghc-9.6
single-constraint-parens: never
sort-constraints: true
sort-derived-classes: true
sort-derived-clauses: true
trailing-section-operators: false
unicode: never # default
respectful: true # default
fixities: [] # default
2 changes: 2 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ ghc-options:
- -Wno-missed-specialisations
- -Wno-missing-import-lists
- -Wno-missing-kind-signatures
- -Wno-missing-poly-kind-signatures
- -Wno-missing-role-annotations
- -Wno-missing-safe-haskell-mode
- -Wno-prepositive-qualified-module
- -Wno-unsafe
Expand Down
6 changes: 3 additions & 3 deletions restyler.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ library
OverloadedStrings
QuasiQuotes
TypeFamilies
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-poly-kind-signatures -Wno-missing-role-annotations -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe
build-depends:
Blammo
, Glob
Expand Down Expand Up @@ -134,7 +134,7 @@ executable restyle
OverloadedStrings
QuasiQuotes
TypeFamilies
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -Wall -threaded -rtsopts -with-rtsopts=-N
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-poly-kind-signatures -Wno-missing-role-annotations -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe -Wall -threaded -rtsopts -with-rtsopts=-N
build-depends:
aeson
, base
Expand Down Expand Up @@ -178,7 +178,7 @@ test-suite test
OverloadedStrings
QuasiQuotes
TypeFamilies
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missed-specialisations -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-poly-kind-signatures -Wno-missing-role-annotations -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module -Wno-unsafe
build-depends:
Blammo
, aeson
Expand Down
6 changes: 3 additions & 3 deletions src/Restyler/AnnotatedException.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.AnnotatedException
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down Expand Up @@ -40,11 +40,11 @@ suppressWith :: MonadUnliftIO m => a -> m a -> m a
suppressWith x = either (const $ pure x) pure <=< tryAnnotated @SomeException

-- | Log any exception and return '()'
suppressWarn :: (MonadUnliftIO m, MonadLogger m) => m () -> m ()
suppressWarn :: (MonadLogger m, MonadUnliftIO m) => m () -> m ()
suppressWarn = suppressWarnWith ()

-- | Log any exception and return the given @a@
suppressWarnWith :: (MonadUnliftIO m, MonadLogger m) => a -> m a -> m a
suppressWarnWith :: (MonadLogger m, MonadUnliftIO m) => a -> m a -> m a
suppressWarnWith x = either warn pure <=< tryAnnotated @SomeException
where
warn ex = do
Expand Down
12 changes: 6 additions & 6 deletions src/Restyler/App.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.App
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand All @@ -28,15 +28,15 @@ newtype AppT app m a = AppT
{ unwrap :: ReaderT app m a
}
deriving newtype
( Functor
, Applicative
( Applicative
, Functor
, Monad
, MonadThrow
, MonadCatch
, MonadMask
, MonadIO
, MonadUnliftIO
, MonadMask
, MonadReader app
, MonadThrow
, MonadUnliftIO
)
deriving (MonadLogger, MonadLoggerIO) via (WithLogger app m)
deriving (MonadDirectory) via (ActualDirectory (AppT app m))
Expand Down
4 changes: 2 additions & 2 deletions src/Restyler/CLI.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.CLI
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand All @@ -18,7 +18,7 @@ import Restyler.Config.FailOnDifferences
import Restyler.RestyleResult

main
:: (HasLogger app, HasFailOnDifferences app)
:: (HasFailOnDifferences app, HasLogger app)
=> (forall a. (app -> IO a) -> IO a)
-> AppT app IO RestyleResult
-> IO ()
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-- | Handling of @.restyled.yaml@ content and behavior driven there-by
--
-- Module : Restyler.Config
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
4 changes: 2 additions & 2 deletions src/Restyler/Config/CommitTemplate.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.CommitTemplate
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand All @@ -27,7 +27,7 @@ newtype CommitTemplate = CommitTemplate
{ unwrap :: Text
}
deriving stock (Eq)
deriving newtype (Show, IsString, HasCodec)
deriving newtype (HasCodec, IsString, Show)

commitTemplateParser :: Parser CommitTemplate
commitTemplateParser =
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/DryRun.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.DryRun
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/Enabled.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.Enabled
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/Exclude.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.Exclude
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/FailOnDifferences.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.FailOnDifferences
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
4 changes: 2 additions & 2 deletions src/Restyler/Config/Glob.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- | Small wrapper over @'System.FilePath.Glob.Pattern'@
--
-- Module : Restyler.Config.Glob
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand All @@ -24,7 +24,7 @@ import System.FilePath.Glob qualified as Glob

newtype Glob a = Glob {unwrap :: String}
deriving stock (Eq)
deriving newtype (Show, IsString, HasCodec)
deriving newtype (HasCodec, IsString, Show)

class GlobTarget a where
forMatch :: a -> String
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/HostDirectory.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.HostDirectory
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/Ignore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- |
--
-- Module : Restyler.Config.Ignore
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
4 changes: 2 additions & 2 deletions src/Restyler/Config/Image.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- |
--
-- Module : Restyler.Config.Image
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand All @@ -26,7 +26,7 @@ data Image = Image
, name :: Maybe (First Text)
, tag :: Maybe (First Text)
}
deriving stock (Eq, Show, Generic)
deriving stock (Eq, Generic, Show)
deriving (Semigroup) via (GenericSemigroupMonoid Image)
deriving (FromJSON, ToJSON) via (Autodocodec Image)

Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/ImageCleanup.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.ImageCleanup
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/Include.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.Include
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/Interpreter.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.Interpreter
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
8 changes: 4 additions & 4 deletions src/Restyler/Config/LogSettings.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- |
--
-- Module : Restyler.Config.LogSettings
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down Expand Up @@ -36,12 +36,12 @@ instance HasCodec LogColor where
newtype Mod a = Mod
{ appMod :: a -> a
}
deriving (Semigroup, Monoid) via (Dual (Endo a))
deriving (Monoid, Semigroup) via (Dual (Endo a))

newtype LogSettingsOption = LogSettingsOption
{ unwrap :: Mod LogSettings
}
deriving newtype (Semigroup, Monoid)
deriving newtype (Monoid, Semigroup)

getLogSettings :: LogSettingsOption -> IO LogSettings
getLogSettings settings = modLogSettings settings <$> LogSettings.parse
Expand Down Expand Up @@ -90,8 +90,8 @@ colorParser =
. Mod
. setLogSettingsColor
<$> withShownDefault
(const "auto")
LogColorAuto
"auto"
( setting
[ help "Enable color WHEN"
, option
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/Manifest.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.Manifest
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Restyler/Config/NoClean.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- |
--
-- Module : Restyler.Config.NoClean
-- Copyright : (c) 2024 Patrick Brisbin
-- Copyright : (c) 2025 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : [email protected]
-- Stability : experimental
Expand Down
Loading
Loading