Skip to content

Commit 7bee753

Browse files
authored
Merge pull request #19 from codacy/improve-package-names
Improve package names
2 parents 63f702e + ee4ad0f commit 7bee753

File tree

17 files changed

+121
-167
lines changed

17 files changed

+121
-167
lines changed

build.sbt

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,31 @@
1-
name := """codacy-plugins-api"""
2-
1+
name := "codacy-plugins-api"
32
version := "1.0.0-SNAPSHOT"
3+
organization := "com.codacy"
44

55
scalaVersion := "2.11.12"
6-
76
crossScalaVersions := Seq(scalaVersion.value, "2.12.4")
87

9-
organization := "com.codacy"
10-
11-
libraryDependencies ++= Seq(
12-
"org.specs2" %% "specs2-core" % "4.0.2" % Test
13-
)
8+
libraryDependencies ++= Seq("org.specs2" %% "specs2-core" % "4.0.2" % Test)
149

10+
description := "Library to develop Codacy tool plugins"
11+
homepage := Some(url("https://github.com/codacy/codacy-plugins-api"))
12+
startYear := Some(2016)
1513
organizationName := "Codacy"
16-
1714
organizationHomepage := Some(new URL("https://www.codacy.com"))
15+
licenses := Seq("The Apache Software License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
1816

1917
publishMavenStyle := true
20-
2118
publishArtifact in Test := false
22-
2319
pomIncludeRepository := { _ =>
2420
false
2521
}
26-
2722
publishTo := {
2823
val nexus = "https://oss.sonatype.org/"
2924
if (version.value.trim.endsWith("SNAPSHOT"))
3025
Some("snapshots" at nexus + "content/repositories/snapshots")
3126
else
3227
Some("releases" at nexus + "service/local/staging/deploy/maven2")
3328
}
34-
35-
startYear := Some(2016)
36-
37-
description := "Library to develop Codacy tool plugins"
38-
39-
licenses := Seq("The Apache Software License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
40-
41-
homepage := Some(url("https://github.com/codacy/codacy-plugins-api"))
42-
4329
pomExtra :=
4430
<scm>
4531
<url>https://github.com/codacy/codacy-plugins-api</url>

project/plugins.sbt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ resolvers ++= Seq(DefaultMavenRepository,
66
Classpaths.typesafeReleases,
77
Classpaths.sbtPluginReleases)
88

9+
// Sonatype publishing
910
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.5.1")
10-
1111
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
1212

13+
// Dependency updates
1314
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.9")
1415

16+
// Coverage
1517
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
16-
1718
addSbtPlugin("com.codacy" % "sbt-codacy-coverage" % "1.3.12")

src/main/scala/codacy/docker/api/DockerApi.scala

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/main/scala/codacy/docker/api/Tool.scala

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/main/scala/codacy/docker/api/duplication/DuplicationTool.scala

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/main/scala/codacy/docker/api/metrics/MetricsTool.scala

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.codacy.plugins.api
2+
3+
sealed trait Source extends Any {
4+
def path: String
5+
6+
override def toString: String = path
7+
}
8+
9+
object Source {
10+
11+
case class Directory(path: String) extends AnyVal with Source
12+
13+
case class File(path: String) extends AnyVal with Source
14+
15+
case class Line(value: Int) extends AnyVal {
16+
override def toString: String = value.toString
17+
}
18+
19+
}
20+
21+
case class ErrorMessage(value: String) extends AnyVal {
22+
override def toString: String = value
23+
}
24+
25+
object Options {
26+
27+
case class Key(value: String) extends AnyVal
28+
29+
// JsonEncoded!
30+
trait Value extends Any
31+
32+
}

src/main/scala/codacy/docker/api/duplication/Duplication.scala renamed to src/main/scala/com/codacy/plugins/api/duplication/Duplication.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package codacy.docker.api.duplication
1+
package com.codacy.plugins.api.duplication
22

33
case class DuplicationCloneFile(filePath: String, startLine: Int, endLine: Int)
44

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.codacy.plugins.api.duplication
2+
3+
import com.codacy.plugins.api.languages.Language
4+
import com.codacy.plugins.api.{Options, Source}
5+
6+
import scala.util.Try
7+
8+
trait DuplicationTool {
9+
def apply(path: Source.Directory,
10+
language: Option[Language],
11+
options: Map[Options.Key, Options.Value]): Try[List[DuplicationClone]]
12+
}
13+
14+
object DuplicationTool {
15+
case class CodacyConfiguration(language: Option[Language], params: Option[Map[Options.Key, Options.Value]])
16+
}

src/main/scala/com/codacy/api/dtos/Language.scala renamed to src/main/scala/com/codacy/plugins/api/languages/Language.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.codacy.api.dtos
1+
package com.codacy.plugins.api.languages
22

33
sealed abstract class Language(val extensions: Set[String],
44
val overriddenName: Option[String] = Option.empty[String],

0 commit comments

Comments
 (0)