From 80eea8a448f3f4763f5d69e2a94acc20f43516f7 Mon Sep 17 00:00:00 2001 From: Nikita Volkov Date: Tue, 7 May 2024 09:30:21 +0300 Subject: [PATCH] Modernize and format --- .github/workflows/format.yaml | 9 ++ .../workflows/on-push-to-master-or-pr.yaml | 2 +- .github/workflows/on-push-to-release.yaml | 9 +- hasql-transaction.cabal | 142 ++++++++---------- 4 files changed, 77 insertions(+), 85 deletions(-) create mode 100644 .github/workflows/format.yaml diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..243bc33 --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,9 @@ +name: Format + +on: + workflow_call: + +jobs: + format: + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/format.yaml@v3 + secrets: inherit diff --git a/.github/workflows/on-push-to-master-or-pr.yaml b/.github/workflows/on-push-to-master-or-pr.yaml index 79c21f5..aa9171e 100644 --- a/.github/workflows/on-push-to-master-or-pr.yaml +++ b/.github/workflows/on-push-to-master-or-pr.yaml @@ -9,7 +9,7 @@ on: jobs: format: - uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/format.yaml@v2 + uses: ./.github/workflows/format.yaml secrets: inherit check: diff --git a/.github/workflows/on-push-to-release.yaml b/.github/workflows/on-push-to-release.yaml index 9024112..dd3f3b3 100644 --- a/.github/workflows/on-push-to-release.yaml +++ b/.github/workflows/on-push-to-release.yaml @@ -10,14 +10,14 @@ on: concurrency: group: release - cancel-in-progress: false + cancel-in-progress: true jobs: format: - uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/format.yaml@v2 + uses: ./.github/workflows/format.yaml secrets: inherit - + check: uses: ./.github/workflows/check.yaml secrets: inherit @@ -26,7 +26,8 @@ jobs: needs: - format - check - uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/release.yaml@v2 + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/release.yaml@v3 secrets: inherit with: prefix-tag-with-v: false + docs: true diff --git a/hasql-transaction.cabal b/hasql-transaction.cabal index 02c14b6..f10acfd 100644 --- a/hasql-transaction.cabal +++ b/hasql-transaction.cabal @@ -1,31 +1,29 @@ -name: hasql-transaction -version: 1.1.0.1 -category: Hasql, Database, PostgreSQL +cabal-version: 3.0 +name: hasql-transaction +version: 1.1.0.1 +category: Hasql, Database, PostgreSQL synopsis: Composable abstraction over retryable transactions for Hasql -homepage: https://github.com/nikita-volkov/hasql-transaction -bug-reports: https://github.com/nikita-volkov/hasql-transaction/issues -author: Nikita Volkov -maintainer: Nikita Volkov -copyright: (c) 2015, Nikita Volkov -license: MIT -license-file: LICENSE -build-type: Simple -cabal-version: >=1.10 +homepage: https://github.com/nikita-volkov/hasql-transaction +bug-reports: https://github.com/nikita-volkov/hasql-transaction/issues +author: Nikita Volkov +maintainer: Nikita Volkov +copyright: (c) 2015, Nikita Volkov +license: MIT +license-file: LICENSE extra-source-files: CHANGELOG.md source-repository head - type: git + type: git location: git://github.com/nikita-volkov/hasql-transaction.git -library - hs-source-dirs: library +common base + default-language: Haskell2010 default-extensions: - NoImplicitPrelude - NoMonomorphismRestriction - Arrows + ApplicativeDo BangPatterns + BlockArguments ConstraintKinds DataKinds DefaultSignatures @@ -34,6 +32,7 @@ library DeriveFunctor DeriveGeneric DeriveTraversable + DerivingVia EmptyDataDecls FlexibleContexts FlexibleInstances @@ -42,24 +41,41 @@ library GeneralizedNewtypeDeriving LambdaCase LiberalTypeSynonyms - MagicHash MultiParamTypeClasses MultiWayIf + NoImplicitPrelude + NoMonomorphismRestriction OverloadedStrings - ParallelListComp PatternGuards QuasiQuotes RankNTypes RecordWildCards + RoleAnnotations ScopedTypeVariables StandaloneDeriving - TemplateHaskell + StrictData TupleSections TypeFamilies TypeOperators - UnboxedTuples - default-language: Haskell2010 +common executable + import: base + ghc-options: + -O2 + -threaded + -with-rtsopts=-N + -rtsopts + -funbox-strict-fields + +common test + import: base + ghc-options: + -threaded + -with-rtsopts=-N + +library + import: base + hs-source-dirs: library exposed-modules: Hasql.Transaction Hasql.Transaction.Sessions @@ -67,72 +83,38 @@ library other-modules: Hasql.Transaction.Config Hasql.Transaction.Private.Prelude - Hasql.Transaction.Private.Sessions Hasql.Transaction.Private.SQL + Hasql.Transaction.Private.Sessions Hasql.Transaction.Private.Statements Hasql.Transaction.Private.Transaction build-depends: - base >=4.12 && <5 - , bytestring >=0.10 && <0.13 - , bytestring-tree-builder >=0.2.7.8 && <0.3 - , contravariant >=1.3 && <2 - , contravariant-extras >=0.3 && <0.4 - , hasql >=1.6 && <1.7 - , mtl >=2.2 && <3 - , transformers >=0.5 && <0.7 + base >=4.12 && <5, + bytestring >=0.10 && <0.13, + bytestring-tree-builder >=0.2.7.8 && <0.3, + contravariant >=1.3 && <2, + contravariant-extras >=0.3 && <0.4, + hasql >=1.6 && <1.7, + mtl >=2.2 && <3, + transformers >=0.5 && <0.7, test-suite conflicts-test - type: exitcode-stdio-1.0 - hs-source-dirs: conflicts-test - default-extensions: - NoImplicitPrelude - NoMonomorphismRestriction - Arrows - BangPatterns - ConstraintKinds - DataKinds - DefaultSignatures - DeriveDataTypeable - DeriveFoldable - DeriveFunctor - DeriveGeneric - DeriveTraversable - EmptyDataDecls - FlexibleContexts - FlexibleInstances - FunctionalDependencies - GADTs - GeneralizedNewtypeDeriving - LambdaCase - LiberalTypeSynonyms - MagicHash - MultiParamTypeClasses - MultiWayIf - OverloadedStrings - ParallelListComp - PatternGuards - QuasiQuotes - RankNTypes - RecordWildCards - ScopedTypeVariables - StandaloneDeriving - TemplateHaskell - TupleSections - TypeFamilies - TypeOperators - UnboxedTuples - - default-language: Haskell2010 - main-is: Main.hs + import: test + type: exitcode-stdio-1.0 + hs-source-dirs: conflicts-test + main-is: Main.hs other-modules: Main.Statements Main.Transactions - ghc-options: -O2 -threaded -with-rtsopts=-N + ghc-options: + -O2 + -threaded + -with-rtsopts=-N + build-depends: - async >=2.1 && <3 - , contravariant-extras >=0.3 && <0.4 - , hasql - , hasql-transaction - , rerebase >=1.11 && <2 + async >=2.1 && <3, + contravariant-extras >=0.3 && <0.4, + hasql, + hasql-transaction, + rerebase >=1.11 && <2,