Skip to content

Commit

Permalink
Reformat with scalafmt 3.8.5
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
oss-47 committed Jan 17, 2025
1 parent 5c85d92 commit d5d5617
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 43 deletions.
9 changes: 4 additions & 5 deletions src/main/scala/microsites/MicrositeKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,8 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {
Def
.sequential(createMicrositeVersions, clean, makeVersionedMicrosite, moveMicrositeVersions)
.value,
ghpagesPrivateMappings := {
sbt.Path.allSubpaths((makeSite / target).value).toList
},
ghpagesPrivateMappings :=
sbt.Path.allSubpaths((makeSite / target).value).toList,
pushMicrosite := Def.taskDyn {
val siteDir: File = (makeSite / target).value
val noJekyll: Boolean = ghpagesNoJekyll.value
Expand All @@ -490,7 +489,7 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {
(pushSiteWith.name, gitHosting.name) match {
case (GHPagesPlugin.name, _) => ghpagesPushSite
case (GitHub4s.name, GitHub.name) if githubToken.nonEmpty =>
Def.task({
Def.task {
val commitMessage = sys.env.getOrElse("SBT_GHPAGES_COMMIT_MESSAGE", "updated site")

log.info(s"""Committing files from ${siteDir.getAbsolutePath} into branch '$branch'
Expand Down Expand Up @@ -518,7 +517,7 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {
}
}
.unsafeRunSync()
})
}
case (GitHub4s.name, GitHub.name) =>
Def.task(
log.error(
Expand Down
9 changes: 5 additions & 4 deletions src/test/scala/microsites/DocsLayoutTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ class DocsLayoutTest extends AnyFunSuite with Checkers with Matchers with Arbitr

test("scriptsDocs TypeTag list shouldn't be empty") {

val property = forAll { implicit settings: MicrositeSettings
val layout = new DocsLayout(settings)
val property = forAll {
implicit settings: MicrositeSettings
val layout = new DocsLayout(settings)

layout.scriptsDocs should not be empty
layout.scriptsDocs.nonEmpty
layout.scriptsDocs should not be empty
layout.scriptsDocs.nonEmpty
}

check(property)
Expand Down
9 changes: 5 additions & 4 deletions src/test/scala/microsites/HomeLayoutTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ class HomeLayoutTest extends AnyFunSuite with Checkers with Matchers with Arbitr

test("homeMain should return a `main` TypeTag") {

val property = forAll { implicit settings: MicrositeSettings
val layout = new HomeLayout(settings)
val property = forAll {
implicit settings: MicrositeSettings
val layout = new HomeLayout(settings)

layout.homeMain.tag shouldBe "main"
!layout.homeMain.void
layout.homeMain.tag shouldBe "main"
!layout.homeMain.void
}

check(property)
Expand Down
58 changes: 32 additions & 26 deletions src/test/scala/microsites/LayoutTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,56 +35,60 @@ class LayoutTest extends AnyFunSuite with Checkers with Matchers with Arbitrarie

test("meta TypeTag list shouldn't be empty") {

val property = forAll { implicit settings: MicrositeSettings
val layout = buildParentLayout
val property = forAll {
implicit settings: MicrositeSettings
val layout = buildParentLayout

layout.metas should not be empty
layout.metas.nonEmpty
layout.metas should not be empty
layout.metas.nonEmpty
}

check(property)
}

test("styles TypeTag list shouldn't be empty") {

val property = forAll { implicit settings: MicrositeSettings
val layout = buildParentLayout
val property = forAll {
implicit settings: MicrositeSettings
val layout = buildParentLayout

layout.styles should not be empty
layout.styles.nonEmpty
layout.styles should not be empty
layout.styles.nonEmpty
}

check(property)
}

test("scripts TypeTag list shouldn't be empty") {

val property = forAll { implicit settings: MicrositeSettings
val layout = buildParentLayout
val property = forAll {
implicit settings: MicrositeSettings
val layout = buildParentLayout

layout.scripts should not be empty
layout.scripts.nonEmpty
layout.scripts should not be empty
layout.scripts.nonEmpty
}

check(property)
}

test("globalFooter TypeTag should be `footer`") {

val property = forAll { implicit settings: MicrositeSettings
val layout = buildParentLayout
val property = forAll {
implicit settings: MicrositeSettings
val layout = buildParentLayout

layout.globalFooter.tag shouldBe "footer"
!layout.globalFooter.void
layout.globalFooter.tag shouldBe "footer"
!layout.globalFooter.void
}

check(property)
}

test("globalFooter TypeTag should have the appropriate content") {

val property = forAll { implicit settings: MicrositeSettings
(settings.templateTexts.footer.isDefined) ==> {
val property = forAll {
implicit settings: MicrositeSettings (settings.templateTexts.footer.isDefined) ==> {
val layout = buildParentLayout

layout.globalFooter.render contains settings.templateTexts.footer.get
Expand All @@ -96,24 +100,26 @@ class LayoutTest extends AnyFunSuite with Checkers with Matchers with Arbitrarie

test("globalFooter TypeTag should have the appropriate number of </div>s") {

val property = forAll { implicit settings: MicrositeSettings
val layout = buildParentLayout
val property = forAll {
implicit settings: MicrositeSettings
val layout = buildParentLayout

val footer = settings.templateTexts.footer
val footer = settings.templateTexts.footer

"</div>".r.findAllIn(layout.globalFooter.render).length === (4 + footer.fold(0)(_ => 2))
"</div>".r.findAllIn(layout.globalFooter.render).length === (4 + footer.fold(0)(_ => 2))
}

check(property)
}

test("buildCollapseMenu TypeTag should be a `div`") {

val property = forAll { implicit settings: MicrositeSettings
val layout = buildParentLayout
val property = forAll {
implicit settings: MicrositeSettings
val layout = buildParentLayout

layout.buildCollapseMenu.tag shouldBe "nav"
!layout.buildCollapseMenu.void
layout.buildCollapseMenu.tag shouldBe "nav"
!layout.buildCollapseMenu.void
}

check(property)
Expand Down
9 changes: 5 additions & 4 deletions src/test/scala/microsites/PageLayoutTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ class PageLayoutTest extends AnyFunSuite with Checkers with Matchers with Arbitr

test("pageMain should return a `main` TypeTag") {

val property = forAll { implicit settings: MicrositeSettings
val layout = new PageLayout(settings)
val property = forAll {
implicit settings: MicrositeSettings
val layout = new PageLayout(settings)

layout.pageMain.tag shouldBe "main"
!layout.pageMain.void
layout.pageMain.tag shouldBe "main"
!layout.pageMain.void
}

check(property)
Expand Down

0 comments on commit d5d5617

Please sign in to comment.