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

Update scalafmt-core to 3.6.1 #304

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.6.1
eaafed401980749eb08523a28366c73d36ef4437
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.6.0"
version = "3.6.1"

preset = "defaultWithAlign"
runner.dialect = "scala213"
Expand Down
19 changes: 15 additions & 4 deletions src/sbt-test/sbt-header/no-file-extensions/test.sbt
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
headerLicense := Some(HeaderLicense.ALv2("2015", "Heiko Seeberger"))

// Files named exactly "routes" (with no extension)
headerMappings := headerMappings.value + (HeaderFileType("", None, "routes") -> HeaderCommentStyle.hashLineComment)
headerMappings := headerMappings.value + (HeaderFileType(
"",
None,
"routes"
) -> HeaderCommentStyle.hashLineComment)
// Files named exactly "more.routes"
headerMappings := headerMappings.value + (HeaderFileType("routes", None, "more") -> HeaderCommentStyle.cStyleBlockComment)
headerMappings := headerMappings.value + (HeaderFileType(
"routes",
None,
"more"
) -> HeaderCommentStyle.cStyleBlockComment)
// Hidden files named exactly ".routes"
headerMappings := headerMappings.value + (HeaderFileType("", None, ".routes") -> HeaderCommentStyle.cppStyleLineComment)
headerMappings := headerMappings.value + (HeaderFileType(
"",
None,
".routes"
) -> HeaderCommentStyle.cppStyleLineComment)

// Do not exclude hidden files (.filename)
unmanagedResources / excludeFilter := (_ => false)


val checkFileContents = taskKey[Unit]("Verify file contents match expected contents")

checkFileContents := {
Expand Down
16 changes: 12 additions & 4 deletions src/sbt-test/sbt-header/simple/test.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ headerLicense := Some(HeaderLicense.ALv2("2015", "Heiko Seeberger"))
// A file named exactly "routes" will NOT be taken into account even if the header extension is "routes"
// A hidden file .routes must be treated with file name ".routes" and without extension
// A hidden file .some.routes must be treated with extension "*.routes"
headerMappings := headerMappings.value + (HeaderFileType("routes") -> HeaderCommentStyle.cppStyleLineComment)
headerMappings := headerMappings.value + (HeaderFileType(
"routes"
) -> HeaderCommentStyle.cppStyleLineComment)
// Do not exclude hidden files (.filename)
unmanagedResources / excludeFilter := (_ => false)

Expand All @@ -12,9 +14,15 @@ val checkFileContents = taskKey[Unit]("Verify file contents match expected conte
checkFileContents := {
checkFile("HasHeader.scala", scalaSource.in(Compile).value)
checkFile("HasNoHeader.scala", scalaSource.in(Compile).value)
checkFile("routes", resourceDirectory.in(Compile).value)
checkFile(".routes", resourceDirectory.in(Compile).value) // does not have extension, file name is only ".routes"
checkFile(".some.routes", resourceDirectory.in(Compile).value) // hidden file with extension .routes
checkFile("routes", resourceDirectory.in(Compile).value)
checkFile(
".routes",
resourceDirectory.in(Compile).value
) // does not have extension, file name is only ".routes"
checkFile(
".some.routes",
resourceDirectory.in(Compile).value
) // hidden file with extension .routes

def checkFile(name: String, sourceDir: sbt.File) = {
val actualPath = (sourceDir / name).toString
Expand Down