From 2a944c25ca577ec3f7f0eac1654c78fe6e5338de Mon Sep 17 00:00:00 2001 From: Tiago Mota Date: Thu, 23 Sep 2021 13:57:24 +0100 Subject: [PATCH 1/5] Bump scalafmt --- .scalafmt.conf | 9 +++++---- project/AutomaticModuleName.scala | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index 1a66ac9e..fbd98e38 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,9 +1,10 @@ -version = 2.7.5 +version = 3.0.4 style = defaultWithAlign -docstrings = JavaDoc -indentOperator = spray +runner.dialect = "scala213" +docstrings.style = keep +indentOperator.preset = spray maxColumn = 120 rewrite.rules = [RedundantParens, SortImports, AvoidInfix] unindentTopLevelOperators = true @@ -12,7 +13,7 @@ align.openParenDefnSite = false align.openParenCallSite = false optIn.breakChainOnFirstMethodDot = false optIn.configStyleArguments = false -danglingParentheses = false +danglingParentheses.preset = false spaces.inImportCurlyBraces = true rewrite.neverInfix.excludeFilters = [ and diff --git a/project/AutomaticModuleName.scala b/project/AutomaticModuleName.scala index 59f894ad..9844e225 100644 --- a/project/AutomaticModuleName.scala +++ b/project/AutomaticModuleName.scala @@ -9,12 +9,13 @@ import sbt.{ Def, _ } * * !! DO NOT BE TEMPTED INTO AUTOMATICALLY DERIVING THE NAMES FROM PROJECT NAMES !! * - * The names carry a lot of implications and DO NOT have to always align 1:1 with the group ids or package names, - * though there should be of course a strong relationship between them. + * The names carry a lot of implications and DO NOT have to always align 1:1 with the group ids or package names, though + * there should be of course a strong relationship between them. */ object AutomaticModuleName { private val AutomaticModuleName = "Automatic-Module-Name" - def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] = - Seq(packageOptions in (Compile, packageBin) += Package.ManifestAttributes(AutomaticModuleName -> name)) + def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] = Seq( + Compile / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name), + packageBin / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name)) } From 1ccccfec44227b420cb0f232e616ec3f84950118 Mon Sep 17 00:00:00 2001 From: Tiago Mota Date: Thu, 23 Sep 2021 13:57:36 +0100 Subject: [PATCH 2/5] Bump docs site deps to solve potential security vulnerability --- docs/Gemfile | 13 ++- docs/Gemfile.lock | 220 ++++++++++++++++++++++++++-------------------- 2 files changed, 129 insertions(+), 104 deletions(-) diff --git a/docs/Gemfile b/docs/Gemfile index 6d7d76d7..459b77ad 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -8,29 +8,26 @@ source "https://rubygems.org" # # This will help ensure the proper Jekyll version is running. # Happy Jekylling! -gem "jekyll", "~> 3.8.7" # This is the default theme for new Jekyll sites. You may change this to anything you like. -gem "minima", "~> 2.0" +gem "minima", "~> 2.5.1" # If you want to use GitHub Pages, remove the "gem "jekyll"" above and # uncomment the line below. To upgrade, run `bundle update github-pages`. -# gem "github-pages", group: :jekyll_plugins +gem "github-pages", group: :jekyll_plugins +gem "just-the-docs" # If you have any plugins, put them here! group :jekyll_plugins do - gem "jekyll-feed", "~> 0.6" + gem "jekyll-feed", "~> 0.9" end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem # and associated library. install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do - gem "tzinfo", "~> 1.2" + gem "tzinfo", "~> 1.2.7" gem "tzinfo-data" end # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform? - -gem "github-pages", "~> 206", group: :jekyll_plugins -gem "just-the-docs" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 284e1c37..b21bfc82 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.2) + activesupport (6.0.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -16,84 +16,102 @@ GEM colorator (1.1.0) commonmarker (0.17.13) ruby-enum (~> 0.5) - concurrent-ruby (1.1.6) - dnsruby (1.61.3) - addressable (~> 2.5) - em-websocket (0.5.1) + concurrent-ruby (1.1.9) + dnsruby (1.61.7) + simpleidn (~> 0.1) + em-websocket (0.5.2) eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) - ethon (0.12.0) - ffi (>= 1.3.0) + ethon (0.14.0) + ffi (>= 1.15.0) eventmachine (1.2.7) - execjs (2.7.0) - faraday (1.0.1) + execjs (2.8.1) + faraday (1.8.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) multipart-post (>= 1.2, < 3) - ffi (1.13.1) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + ffi (1.15.4) forwardable-extended (2.6.0) gemoji (3.0.1) - github-pages (206) - github-pages-health-check (= 1.16.1) - jekyll (= 3.8.7) + github-pages (219) + github-pages-health-check (= 1.17.7) + jekyll (= 3.9.0) jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) jekyll-commonmark-ghpages (= 0.1.6) jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.13.0) + jekyll-feed (= 0.15.1) jekyll-gist (= 1.5.0) jekyll-github-metadata (= 2.13.0) - jekyll-mentions (= 1.5.1) + jekyll-mentions (= 1.6.0) jekyll-optional-front-matter (= 0.3.2) jekyll-paginate (= 1.1.0) jekyll-readme-index (= 0.3.0) - jekyll-redirect-from (= 0.15.0) + jekyll-redirect-from (= 0.16.0) jekyll-relative-links (= 0.6.1) - jekyll-remote-theme (= 0.4.1) + jekyll-remote-theme (= 0.4.3) jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.6.1) + jekyll-seo-tag (= 2.7.1) jekyll-sitemap (= 1.4.0) jekyll-swiss (= 1.0.0) - jekyll-theme-architect (= 0.1.1) - jekyll-theme-cayman (= 0.1.1) - jekyll-theme-dinky (= 0.1.1) - jekyll-theme-hacker (= 0.1.1) - jekyll-theme-leap-day (= 0.1.1) - jekyll-theme-merlot (= 0.1.1) - jekyll-theme-midnight (= 0.1.1) - jekyll-theme-minimal (= 0.1.1) - jekyll-theme-modernist (= 0.1.1) - jekyll-theme-primer (= 0.5.4) - jekyll-theme-slate (= 0.1.1) - jekyll-theme-tactile (= 0.1.1) - jekyll-theme-time-machine (= 0.1.1) + jekyll-theme-architect (= 0.2.0) + jekyll-theme-cayman (= 0.2.0) + jekyll-theme-dinky (= 0.2.0) + jekyll-theme-hacker (= 0.2.0) + jekyll-theme-leap-day (= 0.2.0) + jekyll-theme-merlot (= 0.2.0) + jekyll-theme-midnight (= 0.2.0) + jekyll-theme-minimal (= 0.2.0) + jekyll-theme-modernist (= 0.2.0) + jekyll-theme-primer (= 0.6.0) + jekyll-theme-slate (= 0.2.0) + jekyll-theme-tactile (= 0.2.0) + jekyll-theme-time-machine (= 0.2.0) jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.11.1) - kramdown (= 1.17.0) + jemoji (= 0.12.0) + kramdown (= 2.3.1) + kramdown-parser-gfm (= 1.1.0) liquid (= 4.0.3) mercenary (~> 0.3) minima (= 2.5.1) nokogiri (>= 1.10.4, < 2.0) - rouge (= 3.19.0) + rouge (= 3.26.0) terminal-table (~> 1.4) - github-pages-health-check (1.16.1) + github-pages-health-check (1.17.7) addressable (~> 2.3) dnsruby (~> 1.60) octokit (~> 4.0) - public_suffix (~> 3.0) + public_suffix (>= 3.0, < 5.0) typhoeus (~> 1.3) - html-pipeline (2.12.3) + html-pipeline (2.14.0) activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.6.0) i18n (0.9.5) concurrent-ruby (~> 1.0) - jekyll (3.8.7) + jekyll (3.9.0) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) i18n (~> 0.7) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 2.0) - kramdown (~> 1.14) + kramdown (>= 1.17, < 3) liquid (~> 4.0) mercenary (~> 0.3.3) pathutil (~> 0.9) @@ -113,14 +131,14 @@ GEM rouge (>= 2.0, < 4.0) jekyll-default-layout (0.1.4) jekyll (~> 3.0) - jekyll-feed (0.13.0) + jekyll-feed (0.15.1) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) jekyll-github-metadata (2.13.0) jekyll (>= 3.4, < 5.0) octokit (~> 4.0, != 4.4.0) - jekyll-mentions (1.5.1) + jekyll-mentions (1.6.0) html-pipeline (~> 2.3) jekyll (>= 3.7, < 5.0) jekyll-optional-front-matter (0.3.2) @@ -128,104 +146,110 @@ GEM jekyll-paginate (1.1.0) jekyll-readme-index (0.3.0) jekyll (>= 3.0, < 5.0) - jekyll-redirect-from (0.15.0) + jekyll-redirect-from (0.16.0) jekyll (>= 3.3, < 5.0) jekyll-relative-links (0.6.1) jekyll (>= 3.3, < 5.0) - jekyll-remote-theme (0.4.1) + jekyll-remote-theme (0.4.3) addressable (~> 2.0) jekyll (>= 3.5, < 5.0) - rubyzip (>= 1.3.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-seo-tag (2.6.1) - jekyll (>= 3.3, < 5.0) + jekyll-seo-tag (2.7.1) + jekyll (>= 3.8, < 5.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) jekyll-swiss (1.0.0) - jekyll-theme-architect (0.1.1) - jekyll (~> 3.5) + jekyll-theme-architect (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.1.1) - jekyll (~> 3.5) + jekyll-theme-cayman (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.1.1) - jekyll (~> 3.5) + jekyll-theme-dinky (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.1.1) - jekyll (~> 3.5) + jekyll-theme-hacker (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.1.1) - jekyll (~> 3.5) + jekyll-theme-leap-day (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.1.1) - jekyll (~> 3.5) + jekyll-theme-merlot (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.1.1) - jekyll (~> 3.5) + jekyll-theme-midnight (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.1.1) - jekyll (~> 3.5) + jekyll-theme-minimal (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.1.1) - jekyll (~> 3.5) + jekyll-theme-modernist (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.5.4) + jekyll-theme-primer (0.6.0) jekyll (> 3.5, < 5.0) jekyll-github-metadata (~> 2.9) jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.1.1) - jekyll (~> 3.5) + jekyll-theme-slate (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.1.1) - jekyll (~> 3.5) + jekyll-theme-tactile (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.1.1) - jekyll (~> 3.5) + jekyll-theme-time-machine (0.2.0) + jekyll (> 3.5, < 5.0) jekyll-seo-tag (~> 2.0) jekyll-titles-from-headings (0.5.3) jekyll (>= 3.3, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - jemoji (0.11.1) + jemoji (0.12.0) gemoji (~> 3.0) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) - just-the-docs (0.3.0) + just-the-docs (0.3.3) jekyll (>= 3.8.5) jekyll-seo-tag (~> 2.0) rake (>= 12.3.1, < 13.1.0) - kramdown (1.17.0) + kramdown (2.3.1) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) liquid (4.0.3) - listen (3.2.1) + listen (3.7.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) - mini_portile2 (2.5.1) + mini_portile2 (2.6.1) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.14.1) + minitest (5.14.4) multipart-post (2.1.1) - nokogiri (1.11.5) - mini_portile2 (~> 2.5.0) + nokogiri (1.12.4) + mini_portile2 (~> 2.6.1) racc (~> 1.4) - octokit (4.18.0) + octokit (4.21.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (3.1.1) + public_suffix (4.0.6) racc (1.5.2) - rake (13.0.1) - rb-fsevent (0.10.4) + rake (13.0.6) + rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) - rouge (3.19.0) - ruby-enum (0.8.0) + rexml (3.2.5) + rouge (3.26.0) + ruby-enum (0.9.0) i18n - rubyzip (2.3.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) safe_yaml (1.0.5) sass (3.7.4) sass-listen (~> 4.0.0) @@ -235,31 +259,35 @@ GEM sawyer (0.8.2) addressable (>= 2.3.5) faraday (> 0.8, < 2.0) + simpleidn (0.2.1) + unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.7) + tzinfo (1.2.9) thread_safe (~> 0.1) - tzinfo-data (1.2020.1) + tzinfo-data (1.2021.1) tzinfo (>= 1.0.0) - unicode-display_width (1.7.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8) + unicode-display_width (1.8.0) wdm (0.1.1) - zeitwerk (2.4.0) + zeitwerk (2.4.2) PLATFORMS ruby DEPENDENCIES - github-pages (~> 206) - jekyll (~> 3.8.7) - jekyll-feed (~> 0.6) + github-pages + jekyll-feed (~> 0.9) just-the-docs - minima (~> 2.0) - tzinfo (~> 1.2) + minima (~> 2.5.1) + tzinfo (~> 1.2.7) tzinfo-data wdm (~> 0.1.0) BUNDLED WITH - 2.1.4 + 2.2.27 From 4e22f207750f9700c4aa5ca08cdd6c10b28c8631 Mon Sep 17 00:00:00 2001 From: Tiago Mota Date: Fri, 24 Sep 2021 08:27:36 +0100 Subject: [PATCH 3/5] Use proper slash syntax --- project/AutomaticModuleName.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/project/AutomaticModuleName.scala b/project/AutomaticModuleName.scala index 9844e225..8cc99e09 100644 --- a/project/AutomaticModuleName.scala +++ b/project/AutomaticModuleName.scala @@ -16,6 +16,5 @@ object AutomaticModuleName { private val AutomaticModuleName = "Automatic-Module-Name" def settings(name: String): Seq[Def.Setting[Task[Seq[PackageOption]]]] = Seq( - Compile / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name), - packageBin / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name)) + Compile / packageBin / packageOptions += Package.ManifestAttributes(AutomaticModuleName -> name)) } From d6fa33ec73ed28f8da675da61c8ed18d68e12bf2 Mon Sep 17 00:00:00 2001 From: Tiago Mota Date: Tue, 28 Sep 2021 16:30:35 +0100 Subject: [PATCH 4/5] Sync scalafmt with akka-persistence-jdbc --- .scalafmt.conf | 8 +++++--- .../akka/persistence/postgres/db/DbErrors.scala | 4 ++-- .../journal/dao/ByteArrayJournalSerializer.scala | 4 ++-- .../postgres/journal/dao/FlatJournalDao.scala | 4 ++-- .../journal/dao/NestedPartitionsJournalDao.scala | 4 ++-- .../journal/dao/PartitionedJournalDao.scala | 4 ++-- .../postgres/query/JournalSequenceActor.scala | 8 ++++---- .../snapshot/dao/ByteArraySnapshotDao.scala | 3 +-- .../query/JournalSequenceActorTest.scala | 4 ++-- .../postgres/query/QueryTestSpec.scala | 16 ++++++++-------- docs/Gemfile.lock | 2 +- .../journal/Jdbc4JournalMigration.scala | 4 ++-- .../snapshot/Jdbc4SnapshotStoreMigration.scala | 4 ++-- 13 files changed, 35 insertions(+), 34 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index fbd98e38..f324a6d0 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -2,8 +2,8 @@ version = 3.0.4 style = defaultWithAlign -runner.dialect = "scala213" -docstrings.style = keep +docstrings.style = Asterisk +docstrings.wrap = no indentOperator.preset = spray maxColumn = 120 rewrite.rules = [RedundantParens, SortImports, AvoidInfix] @@ -13,7 +13,8 @@ align.openParenDefnSite = false align.openParenCallSite = false optIn.breakChainOnFirstMethodDot = false optIn.configStyleArguments = false -danglingParentheses.preset = false +danglingParentheses.defnSite = false +danglingParentheses.callSite = false spaces.inImportCurlyBraces = true rewrite.neverInfix.excludeFilters = [ and @@ -52,3 +53,4 @@ rewriteTokens = { "←": "<-" } newlines.afterCurlyLambda = preserve +newlines.implicitParamListModifierPrefer = before diff --git a/core/src/main/scala/akka/persistence/postgres/db/DbErrors.scala b/core/src/main/scala/akka/persistence/postgres/db/DbErrors.scala index d6d832b9..9f24a611 100644 --- a/core/src/main/scala/akka/persistence/postgres/db/DbErrors.scala +++ b/core/src/main/scala/akka/persistence/postgres/db/DbErrors.scala @@ -28,8 +28,8 @@ object DbErrors { DBIO.successful(()) } - def withHandledIndexErrors(logger: Logger, indexDetails: String)(dbio: DBIOAction[_, NoStream, Effect])(implicit - ec: ExecutionContext): DBIOAction[Unit, NoStream, Effect] = + def withHandledIndexErrors(logger: Logger, indexDetails: String)(dbio: DBIOAction[_, NoStream, Effect])( + implicit ec: ExecutionContext): DBIOAction[Unit, NoStream, Effect] = dbio.asTry.flatMap { case Failure(ex: SQLException) if ex.getSQLState == PgUniqueViolation => logger.debug(s"Index $indexDetails already exists") diff --git a/core/src/main/scala/akka/persistence/postgres/journal/dao/ByteArrayJournalSerializer.scala b/core/src/main/scala/akka/persistence/postgres/journal/dao/ByteArrayJournalSerializer.scala index 93c81038..b521ff36 100644 --- a/core/src/main/scala/akka/persistence/postgres/journal/dao/ByteArrayJournalSerializer.scala +++ b/core/src/main/scala/akka/persistence/postgres/journal/dao/ByteArrayJournalSerializer.scala @@ -17,8 +17,8 @@ import scala.collection.immutable._ import scala.concurrent.{ ExecutionContext, Future } import scala.util.Try -class ByteArrayJournalSerializer(serialization: Serialization, tagConverter: TagIdResolver)(implicit - val executionContext: ExecutionContext) +class ByteArrayJournalSerializer(serialization: Serialization, tagConverter: TagIdResolver)( + implicit val executionContext: ExecutionContext) extends FlowPersistentReprSerializer[JournalRow] { override def serialize(persistentRepr: PersistentRepr, tags: Set[String]): Future[JournalRow] = { diff --git a/core/src/main/scala/akka/persistence/postgres/journal/dao/FlatJournalDao.scala b/core/src/main/scala/akka/persistence/postgres/journal/dao/FlatJournalDao.scala index 55ecb4d8..12feb4c1 100644 --- a/core/src/main/scala/akka/persistence/postgres/journal/dao/FlatJournalDao.scala +++ b/core/src/main/scala/akka/persistence/postgres/journal/dao/FlatJournalDao.scala @@ -9,8 +9,8 @@ import slick.jdbc.JdbcBackend._ import scala.concurrent.ExecutionContext -class FlatJournalDao(val db: Database, val journalConfig: JournalConfig, serialization: Serialization)(implicit - val ec: ExecutionContext, +class FlatJournalDao(val db: Database, val journalConfig: JournalConfig, serialization: Serialization)( + implicit val ec: ExecutionContext, val mat: Materializer) extends BaseByteArrayJournalDao { val queries = new JournalQueries(FlatJournalTable(journalConfig.journalTableConfiguration)) diff --git a/core/src/main/scala/akka/persistence/postgres/journal/dao/NestedPartitionsJournalDao.scala b/core/src/main/scala/akka/persistence/postgres/journal/dao/NestedPartitionsJournalDao.scala index bfb87d0a..149d285a 100644 --- a/core/src/main/scala/akka/persistence/postgres/journal/dao/NestedPartitionsJournalDao.scala +++ b/core/src/main/scala/akka/persistence/postgres/journal/dao/NestedPartitionsJournalDao.scala @@ -13,8 +13,8 @@ import slick.jdbc.JdbcBackend.Database import scala.collection.immutable.{ List, Nil, Seq } import scala.concurrent.{ ExecutionContext, Future } -class NestedPartitionsJournalDao(db: Database, journalConfig: JournalConfig, serialization: Serialization)(implicit - ec: ExecutionContext, +class NestedPartitionsJournalDao(db: Database, journalConfig: JournalConfig, serialization: Serialization)( + implicit ec: ExecutionContext, mat: Materializer) extends FlatJournalDao(db, journalConfig, serialization) { override val queries = new JournalQueries(NestedPartitionsJournalTable(journalConfig.journalTableConfiguration)) diff --git a/core/src/main/scala/akka/persistence/postgres/journal/dao/PartitionedJournalDao.scala b/core/src/main/scala/akka/persistence/postgres/journal/dao/PartitionedJournalDao.scala index d251ff7e..68792bf6 100644 --- a/core/src/main/scala/akka/persistence/postgres/journal/dao/PartitionedJournalDao.scala +++ b/core/src/main/scala/akka/persistence/postgres/journal/dao/PartitionedJournalDao.scala @@ -12,8 +12,8 @@ import slick.jdbc.JdbcBackend.Database import scala.collection.immutable.{ Nil, Seq } import scala.concurrent.{ ExecutionContext, Future } -class PartitionedJournalDao(db: Database, journalConfig: JournalConfig, serialization: Serialization)(implicit - ec: ExecutionContext, +class PartitionedJournalDao(db: Database, journalConfig: JournalConfig, serialization: Serialization)( + implicit ec: ExecutionContext, mat: Materializer) extends FlatJournalDao(db, journalConfig, serialization) { override val queries = new JournalQueries(PartitionedJournalTable(journalConfig.journalTableConfiguration)) diff --git a/core/src/main/scala/akka/persistence/postgres/query/JournalSequenceActor.scala b/core/src/main/scala/akka/persistence/postgres/query/JournalSequenceActor.scala index 01695e89..ffa68afa 100644 --- a/core/src/main/scala/akka/persistence/postgres/query/JournalSequenceActor.scala +++ b/core/src/main/scala/akka/persistence/postgres/query/JournalSequenceActor.scala @@ -17,8 +17,8 @@ import scala.collection.immutable.NumericRange import scala.concurrent.duration.FiniteDuration object JournalSequenceActor { - def props(readJournalDao: ReadJournalDao, config: JournalSequenceRetrievalConfig)(implicit - materializer: Materializer): Props = Props(new JournalSequenceActor(readJournalDao, config)) + def props(readJournalDao: ReadJournalDao, config: JournalSequenceRetrievalConfig)( + implicit materializer: Materializer): Props = Props(new JournalSequenceActor(readJournalDao, config)) private case object QueryOrderingIds private case class NewOrderingIds(originalOffset: Long, elements: Seq[OrderingId]) @@ -56,8 +56,8 @@ object JournalSequenceActor { * This is required to guarantee the EventByTag does not skip any rows in case rows with a higher (ordering) id are * visible in the database before rows with a lower (ordering) id. */ -class JournalSequenceActor(readJournalDao: ReadJournalDao, config: JournalSequenceRetrievalConfig)(implicit - materializer: Materializer) +class JournalSequenceActor(readJournalDao: ReadJournalDao, config: JournalSequenceRetrievalConfig)( + implicit materializer: Materializer) extends Actor with ActorLogging with Timers { diff --git a/core/src/main/scala/akka/persistence/postgres/snapshot/dao/ByteArraySnapshotDao.scala b/core/src/main/scala/akka/persistence/postgres/snapshot/dao/ByteArraySnapshotDao.scala index f08137b7..551e13b1 100644 --- a/core/src/main/scala/akka/persistence/postgres/snapshot/dao/ByteArraySnapshotDao.scala +++ b/core/src/main/scala/akka/persistence/postgres/snapshot/dao/ByteArraySnapshotDao.scala @@ -17,8 +17,7 @@ import scala.concurrent.{ ExecutionContext, Future } import scala.util.{ Failure, Success } class ByteArraySnapshotDao(db: JdbcBackend#Database, snapshotConfig: SnapshotConfig, serialization: Serialization)( - implicit - ec: ExecutionContext, + implicit ec: ExecutionContext, val mat: Materializer) extends SnapshotDao { import akka.persistence.postgres.db.ExtendedPostgresProfile.api._ diff --git a/core/src/test/scala/akka/persistence/postgres/query/JournalSequenceActorTest.scala b/core/src/test/scala/akka/persistence/postgres/query/JournalSequenceActorTest.scala index 0821cb06..be8babf4 100644 --- a/core/src/test/scala/akka/persistence/postgres/query/JournalSequenceActorTest.scala +++ b/core/src/test/scala/akka/persistence/postgres/query/JournalSequenceActorTest.scala @@ -171,8 +171,8 @@ abstract class JournalSequenceActorTest(val schemaType: SchemaType) extends Quer * (since the actor queries every second by default, * this is effectively the number of seconds after which events are assumed missing) */ - def withJournalSequenceActor(db: JdbcBackend.Database, maxTries: Int)(f: ActorRef => Unit)(implicit - system: ActorSystem): Unit = { + def withJournalSequenceActor(db: JdbcBackend.Database, maxTries: Int)(f: ActorRef => Unit)( + implicit system: ActorSystem): Unit = { import system.dispatcher implicit val mat: Materializer = SystemMaterializer(system).materializer val readJournalDao = diff --git a/core/src/test/scala/akka/persistence/postgres/query/QueryTestSpec.scala b/core/src/test/scala/akka/persistence/postgres/query/QueryTestSpec.scala index 8bbd24cb..ef2ff5b3 100644 --- a/core/src/test/scala/akka/persistence/postgres/query/QueryTestSpec.scala +++ b/core/src/test/scala/akka/persistence/postgres/query/QueryTestSpec.scala @@ -44,8 +44,8 @@ trait ReadJournalOperations { def countJournal: Future[Long] } -class ScalaPostgresReadJournalOperations(readJournal: PostgresReadJournal)(implicit - system: ActorSystem, +class ScalaPostgresReadJournalOperations(readJournal: PostgresReadJournal)( + implicit system: ActorSystem, mat: Materializer) extends ReadJournalOperations { def this(system: ActorSystem) = @@ -106,8 +106,8 @@ class ScalaPostgresReadJournalOperations(readJournal: PostgresReadJournal)(impli .map(_.sum) } -class JavaDslPostgresReadJournalOperations(readJournal: javadsl.PostgresReadJournal)(implicit - system: ActorSystem, +class JavaDslPostgresReadJournalOperations(readJournal: javadsl.PostgresReadJournal)( + implicit system: ActorSystem, mat: Materializer) extends ReadJournalOperations { def this(system: ActorSystem) = @@ -300,15 +300,15 @@ abstract class QueryTestSpec(config: String, configOverrides: Map[String, Config system.actorOf(Props(new TestActor(persistenceId, replyToMessages))) } - def withTestActors(seq: Int = 1, replyToMessages: Boolean = false)(f: (ActorRef, ActorRef, ActorRef) => Unit)(implicit - system: ActorSystem): Unit = { + def withTestActors(seq: Int = 1, replyToMessages: Boolean = false)(f: (ActorRef, ActorRef, ActorRef) => Unit)( + implicit system: ActorSystem): Unit = { val refs = (seq until seq + 3).map(setupEmpty(_, replyToMessages)).toList try f(refs.head, refs.drop(1).head, refs.drop(2).head) finally killActors(refs: _*) } - def withManyTestActors(amount: Int, seq: Int = 1, replyToMessages: Boolean = false)(f: Seq[ActorRef] => Unit)(implicit - system: ActorSystem): Unit = { + def withManyTestActors(amount: Int, seq: Int = 1, replyToMessages: Boolean = false)(f: Seq[ActorRef] => Unit)( + implicit system: ActorSystem): Unit = { val refs = (seq until seq + amount).map(setupEmpty(_, replyToMessages)).toList try f(refs) finally killActors(refs: _*) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index b21bfc82..b7202f6f 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -230,7 +230,7 @@ GEM jekyll-seo-tag (~> 2.1) minitest (5.14.4) multipart-post (2.1.1) - nokogiri (1.12.4) + nokogiri (1.12.5) mini_portile2 (~> 2.6.1) racc (~> 1.4) octokit (4.21.0) diff --git a/migration/src/main/scala/akka/persistence/postgres/migration/journal/Jdbc4JournalMigration.scala b/migration/src/main/scala/akka/persistence/postgres/migration/journal/Jdbc4JournalMigration.scala index cbb889fd..ed8e9808 100644 --- a/migration/src/main/scala/akka/persistence/postgres/migration/journal/Jdbc4JournalMigration.scala +++ b/migration/src/main/scala/akka/persistence/postgres/migration/journal/Jdbc4JournalMigration.scala @@ -18,8 +18,8 @@ import scala.concurrent.duration.Duration import scala.concurrent.{ Await, Future } import scala.util.Failure -class Jdbc4JournalMigration(globalConfig: Config, tempTableName: String = "tmp_journal")(implicit - system: ActorSystem, +class Jdbc4JournalMigration(globalConfig: Config, tempTableName: String = "tmp_journal")( + implicit system: ActorSystem, mat: Materializer) extends PgSlickSupport { diff --git a/migration/src/main/scala/akka/persistence/postgres/migration/snapshot/Jdbc4SnapshotStoreMigration.scala b/migration/src/main/scala/akka/persistence/postgres/migration/snapshot/Jdbc4SnapshotStoreMigration.scala index 41f5780d..bff53a10 100644 --- a/migration/src/main/scala/akka/persistence/postgres/migration/snapshot/Jdbc4SnapshotStoreMigration.scala +++ b/migration/src/main/scala/akka/persistence/postgres/migration/snapshot/Jdbc4SnapshotStoreMigration.scala @@ -18,8 +18,8 @@ import scala.concurrent.duration.Duration import scala.concurrent.{ Await, Future } import scala.util.Failure -class Jdbc4SnapshotStoreMigration(globalConfig: Config, tempTableName: String = "tmp_snapshot")(implicit - system: ActorSystem, +class Jdbc4SnapshotStoreMigration(globalConfig: Config, tempTableName: String = "tmp_snapshot")( + implicit system: ActorSystem, mat: Materializer) extends PgSlickSupport { From 92c5e4d2ff0edb3db62829974c390af4b1b22dee Mon Sep 17 00:00:00 2001 From: Tiago Mota Date: Tue, 28 Sep 2021 16:32:08 +0100 Subject: [PATCH 5/5] Update scalafmt to 3.0.5 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index f324a6d0..1ddee7c8 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.0.4 +version = 3.0.5 style = defaultWithAlign