diff --git a/app/Main.hs b/app/Main.hs index 0b34651..321bdbb 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,9 +1,4 @@ -{-# LANGUAGE ApplicativeDo #-} -{-# LANGUAGE BlockArguments #-} -{-# LANGUAGE CPP #-} -{-# LANGUAGE DuplicateRecordFields #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE CPP #-} module Main where diff --git a/nix-diff.cabal b/nix-diff.cabal index 1bd7014..84381b9 100644 --- a/nix-diff.cabal +++ b/nix-diff.cabal @@ -1,3 +1,4 @@ +cabal-version: 3.0 name: nix-diff version: 1.0.20 synopsis: Explain why two Nix derivations differ @@ -5,25 +6,46 @@ description: This package provides a @nix-diff@ executable which explains why two Nix derivations (i.e. @*.drv@ files) differ homepage: https://github.com/Gabriella439/nix-diff -license: BSD3 +license: BSD-3-Clause license-file: LICENSE author: Gabriella Gonzalez maintainer: GenuineGabriella@gmail.com -copyright: 2017 Gabriella Gonzalez +copyright: 2024 Gabriella Gonzalez category: System build-type: Simple -tested-with: GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.5, GHC == 9.4.4 -cabal-version: >= 1.10 +tested-with: GHC == 9.2.8, + GHC == 9.4.7, + GHC == 9.6.3 extra-source-files: README.md CHANGELOG.md +common language + default-language: GHC2021 + default-extensions: + ApplicativeDo, + BlockArguments, + DeriveAnyClass, + DerivingStrategies, + DerivingVia, + DuplicateRecordFields, + LambdaCase, + MultiWayIf, + NamedFieldPuns, + OverloadedStrings, + RecordWildCards, + ghc-options: -Wall + library + import: language + hs-source-dirs: src + exposed-modules: Nix.Diff Nix.Diff.Store Nix.Diff.Types Nix.Diff.Transformations Nix.Diff.Render.HumanReadable + build-depends: base >= 4.9 && < 5 , attoparsec >= 0.13 && < 0.15 , aeson @@ -42,11 +64,10 @@ library , quickcheck-instances < 3.29 , generic-arbitrary < 1.1 , uniplate < 1.17 - hs-source-dirs: src - default-language: Haskell2010 - ghc-options: -Wall executable nix-diff + import: language + hs-source-dirs: app main-is: Main.hs build-depends: base @@ -58,11 +79,12 @@ executable nix-diff , unix < 2.9 , containers , mtl - hs-source-dirs: app - default-language: Haskell2010 - ghc-options: -Wall test-suite nix-diff-test + import: language + ghc-options: -Wall + + hs-source-dirs: test main-is: Main.hs other-modules: @@ -83,8 +105,3 @@ test-suite nix-diff-test , tasty < 1.6 , tasty-quickcheck < 0.11 , tasty-silver < 3.4 - - hs-source-dirs: test - - default-language: Haskell2010 - ghc-options: -Wall diff --git a/src/Nix/Diff.hs b/src/Nix/Diff.hs index ca75b4a..5ddd0dd 100644 --- a/src/Nix/Diff.hs +++ b/src/Nix/Diff.hs @@ -1,11 +1,4 @@ -{-# LANGUAGE ApplicativeDo #-} -{-# LANGUAGE BlockArguments #-} -{-# LANGUAGE CPP #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE CPP #-} module Nix.Diff where @@ -23,7 +16,6 @@ import Data.Vector (Vector) import Nix.Derivation (Derivation, DerivationOutput) import Prelude hiding (unzip) -import qualified Control.Monad.Reader import qualified Data.Attoparsec.Text import qualified Data.ByteString import qualified Data.Char as Char @@ -66,7 +58,7 @@ data Diffed = Diffed } deriving (Eq, Ord) newtype Diff a = Diff { unDiff :: ReaderT DiffContext (StateT Status IO) a } - deriving + deriving newtype ( Functor , Applicative , Monad diff --git a/src/Nix/Diff/Render/HumanReadable.hs b/src/Nix/Diff/Render/HumanReadable.hs index 1e9199a..93dae72 100644 --- a/src/Nix/Diff/Render/HumanReadable.hs +++ b/src/Nix/Diff/Render/HumanReadable.hs @@ -1,12 +1,4 @@ -{-# LANGUAGE ApplicativeDo #-} -{-# LANGUAGE BlockArguments #-} -{-# LANGUAGE CPP #-} -{-# LANGUAGE DuplicateRecordFields #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE CPP #-} module Nix.Diff.Render.HumanReadable where @@ -39,7 +31,7 @@ data RenderContext = RenderContext } newtype Render a = Render { unRender :: ReaderT RenderContext (Writer Text) a} - deriving + deriving newtype ( Functor , Applicative , Monad diff --git a/src/Nix/Diff/Store.hs b/src/Nix/Diff/Store.hs index d785abc..7e6342a 100644 --- a/src/Nix/Diff/Store.hs +++ b/src/Nix/Diff/Store.hs @@ -1,9 +1,3 @@ -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DerivingStrategies #-} -{-# LANGUAGE GeneralisedNewtypeDeriving #-} -{-# LANGUAGE UndecidableInstances #-} -{-# LANGUAGE NoImportQualifiedPost #-} - -- | A crude implementation of the Nix store concept. -- -- For anything fancier than this, it would be best to use FFI bindings instead, diff --git a/src/Nix/Diff/Transformations.hs b/src/Nix/Diff/Transformations.hs index 0ba0020..476aef5 100644 --- a/src/Nix/Diff/Transformations.hs +++ b/src/Nix/Diff/Transformations.hs @@ -1,9 +1,3 @@ -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE MultiWayIf #-} -{-# LANGUAGE BlockArguments #-} -{-# LANGUAGE FlexibleContexts #-} module Nix.Diff.Transformations where import qualified Patience diff --git a/src/Nix/Diff/Types.hs b/src/Nix/Diff/Types.hs index 54fdfdc..3d5302a 100644 --- a/src/Nix/Diff/Types.hs +++ b/src/Nix/Diff/Types.hs @@ -1,15 +1,7 @@ -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE DeriveAnyClass #-} -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE DeriveTraversable #-} -{-# LANGUAGE BlockArguments #-} -{-# LANGUAGE DerivingVia #-} -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# OPTIONS_GHC -Wno-orphans -fconstraint-solver-iterations=0 #-} +-- Needed for `deriving Arbitrary via GenericArbitrary DerivationDiff`: +{-# OPTIONS_GHC -fconstraint-solver-iterations=0 #-} +-- Needed for `deriving instance Data (DerivationOutput StorePath Text)`: +{-# OPTIONS_GHC -Wno-orphans #-} module Nix.Diff.Types where diff --git a/test/Golden/Tests.hs b/test/Golden/Tests.hs index c1bd3c3..6fd4e2d 100644 --- a/test/Golden/Tests.hs +++ b/test/Golden/Tests.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE OverloadedStrings #-} module Golden.Tests where import qualified Data.Aeson diff --git a/test/Golden/Utils.hs b/test/Golden/Utils.hs index 681a4de..974038b 100644 --- a/test/Golden/Utils.hs +++ b/test/Golden/Utils.hs @@ -1,6 +1,3 @@ -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE OverloadedStrings #-} - module Golden.Utils where import qualified Data.ByteString.Lazy.Char8 as BS