Skip to content

Commit 13c2e9f

Browse files
xuwei-kmuuki88
authored andcommitted
fix procedure syntax (#1131)
1 parent d3b5702 commit 13c2e9f

File tree

10 files changed

+16
-17
lines changed

10 files changed

+16
-17
lines changed

src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ trait DebianPluginLike {
380380
script
381381
}
382382

383-
private[debian] final def validateUserGroupNames(user: String, streams: TaskStreams) {
383+
private[debian] final def validateUserGroupNames(user: String, streams: TaskStreams): Unit = {
384384
if ((UserNamePattern findFirstIn user).isEmpty) {
385385
streams.log.warn(
386386
"The user or group '" + user + "' may contain invalid characters for Debian based distributions"

src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ object ZipHelper {
153153
* @param f: FileSystem => Unit, logic working in the filesystem
154154
* @see http://stackoverflow.com/questions/9873845/java-7-zip-file-system-provider-doesnt-seem-to-accept-spaces-in-uri
155155
*/
156-
def withZipFilesystem(zipFile: File, overwrite: Boolean = true)(f: FileSystem => Unit) {
156+
def withZipFilesystem(zipFile: File, overwrite: Boolean = true)(f: FileSystem => Unit): Unit = {
157157
if (overwrite) Files deleteIfExists zipFile.toPath
158158
val env = Map("create" -> "true").asJava
159159
val uri = new URI("jar", zipFile.toPath.toUri().toString(), null)

src/sbt-test/debian/systemd-deb/src/main/scala/test/Main.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
object Main {
4-
def main (args: Array[String]) {
4+
def main (args: Array[String]): Unit = {
55
//server app imitation
66
while (true){
77
Thread.sleep(1000L)

src/sbt-test/debian/test-executableScriptName/src/main/scala/test/Main.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
object Main {
4-
def main (args: Array[String]) {
4+
def main (args: Array[String]): Unit = {
55
//server app imitation
66
while (true){
77
Thread.sleep(1000L)

src/sbt-test/rpm/path-override-rpm/src/main/scala/test/Main.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
object Main {
4-
def main (args: Array[String]) {
4+
def main (args: Array[String]): Unit = {
55
//server app imitation
66
while (true){
77
Thread.sleep(1000L)

src/sbt-test/rpm/systemd-rpm/src/main/scala/test/Main.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
object Main {
4-
def main (args: Array[String]) {
4+
def main (args: Array[String]): Unit = {
55
//server app imitation
66
while (true){
77
Thread.sleep(1000L)

src/sbt-test/rpm/test-executableScriptName/src/main/scala/test/Main.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
object Main {
4-
def main (args: Array[String]) {
4+
def main (args: Array[String]): Unit = {
55
//server app imitation
66
while (true){
77
Thread.sleep(1000L)

src/test/scala/com/typesafe/sbt/packager/universal/ZipHelperSpec.scala

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with
1313
var tmp: Path = _
1414
val toDelete = scala.collection.mutable.ListBuffer[Path]()
1515

16-
override def beforeEach {
16+
override def beforeEach: Unit = {
1717
tmp = Files createTempDirectory "_sbt-native-packager"
1818
toDelete += tmp
1919
}
2020

21-
override def afterAll {
21+
override def afterAll: Unit =
2222
toDelete foreach { dir =>
2323
scala.util.Try {
2424
Files.walkFileTree(dir, new DeleteDirectoryVisitor)
2525
}
2626
}
27-
}
2827

2928
"The ZipHelper.zip" should {
3029

@@ -104,7 +103,7 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with
104103

105104
private type Zipper = (Traversable[(File, String)], File) => Unit
106105

107-
private def zipSingleFile(zipper: Zipper) {
106+
private def zipSingleFile(zipper: Zipper): Unit = {
108107
val out = tmp resolve "single.zip"
109108
val file = Files createFile (tmp resolve "single.txt")
110109

@@ -117,7 +116,7 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with
117116

118117
}
119118

120-
private def zipNestedFile(zipper: Zipper) {
119+
private def zipNestedFile(zipper: Zipper): Unit = {
121120
// setup
122121
val out = tmp resolve "nested.zip"
123122
val dir = tmp resolve "dir"
@@ -137,7 +136,7 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with
137136
}
138137
}
139138

140-
private def zipNestedDirsWithFiles(zipper: Zipper) {
139+
private def zipNestedDirsWithFiles(zipper: Zipper): Unit = {
141140
// setup
142141
val out = tmp resolve "nested-containing.zip"
143142
val dir = tmp resolve "dir"
@@ -158,7 +157,7 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with
158157
}
159158
}
160159

161-
private def createNecessaryDirectories(zipper: Zipper) {
160+
private def createNecessaryDirectories(zipper: Zipper): Unit = {
162161
val out = tmp resolve "dir-creation.zip"
163162
val file = tmp resolve "dir-file.txt"
164163
Files createFile file
@@ -176,7 +175,7 @@ class ZipHelperSpec extends WordSpec with Matchers with BeforeAndAfterEach with
176175
}
177176
}
178177

179-
private def preserveExecutableBit(zipper: Zipper) {
178+
private def preserveExecutableBit(zipper: Zipper): Unit = {
180179
val out = tmp resolve "exec.zip"
181180
val exec = tmp resolve "exec"
182181
Files createFile exec

test-project-simple/src/main/scala/ExampleApp.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object ExampleApp extends App {
1616
}
1717

1818
case class HelloWorld(i: Int) extends Runnable {
19-
def run() {
19+
def run(): Unit = {
2020
println(s"[$i] Hello, world!")
2121
}
2222
}

test-project-windows/src/main/scala/ExampleApp.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object ExampleApp extends App {
1616
}
1717

1818
case class HelloWorld(i: Int) extends Runnable {
19-
def run() {
19+
def run(): Unit = {
2020
println(s"[$i] Hello, world!")
2121
}
2222
}

0 commit comments

Comments
 (0)