This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes some compilation warnings (#128)
- Loading branch information
1 parent
db64df3
commit 0a8b8bf
Showing
7 changed files
with
85 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtorgpolicies.rules | ||
|
||
sealed abstract class PolicyLevel extends Product with Serializable | ||
|
||
case object PolicyWarning extends PolicyLevel | ||
|
||
case object PolicyError extends PolicyLevel | ||
|
||
case class Validation(policyLevel: PolicyLevel, validationRule: ValidationRule) | ||
|
||
case class ValidationRule(inputPath: String, validationList: List[ValidationFunction]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2017 47 Degrees, LLC. <http://www.47deg.com> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package sbtorgpolicies.templates | ||
|
||
import org.joda.time.DateTime | ||
import sbtorgpolicies.templates.syntax._ | ||
|
||
import scala.util.matching.Regex | ||
|
||
trait Replaceable { | ||
|
||
def asString: String | ||
} | ||
|
||
case class ReplaceableT[T](t: T) extends Replaceable { | ||
override def asString: String = t.toString | ||
} | ||
|
||
case class ReplaceableList[T](list: List[T]) extends Replaceable { | ||
override def asString: String = list.map(elem => s"* ${elem.asReplaceable.asString}").mkString("\n") | ||
} | ||
|
||
case class FileType( | ||
mandatory: Boolean, | ||
overWritable: Boolean, | ||
templatePath: String, | ||
outputPath: String, | ||
replacements: Replacements, | ||
fileSections: List[FileSection] = Nil) | ||
|
||
case class FileSection( | ||
appendPosition: AppendPosition, | ||
template: String, | ||
replacements: Replacements, | ||
shouldAppend: (String) => Boolean = _ => true) | ||
|
||
sealed trait AppendPosition | ||
case object AppendAtTheBeginning extends AppendPosition | ||
case object AppendAtTheEnd extends AppendPosition | ||
case class AppendAfter(line: Regex) extends AppendPosition | ||
|
||
case class NewReleaseSection(date: DateTime, version: String, changes: String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
resolvers += Resolver.sonatypeRepo("snapshots") | ||
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.4.3-SNAPSHOT") | ||
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.4.3") | ||
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value |