Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/ajsquared/scalastyle-sbt-pl…
…ugin into ajsquared-master Conflicts: src/main/scala/org/scalastyle/sbt/Plugin.scala
- Loading branch information
Showing
23 changed files
with
198 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.10.0" | ||
|
||
val containsMessage = taskKey[Boolean]("contains message") | ||
|
||
containsMessage := { | ||
val search = "File length exceeds" | ||
val filename = "target/scalastyle-result.xml" | ||
val lines = sbt.IO.readLines(file(filename)) | ||
val contains = lines.find(s => s.contains(search)).isDefined | ||
if (contains) { | ||
sys.error("Found " + search + " in " + filename) | ||
} | ||
contains | ||
} |
1 change: 1 addition & 0 deletions
1
src/sbt-test/specific-files/directories/project/build.properties
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 @@ | ||
sbt.version=0.13.0 |
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,9 @@ | ||
resolvers += "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/" | ||
|
||
{ | ||
val pluginVersion = System.getProperty("plugin.version") | ||
if(pluginVersion == null) | ||
throw new RuntimeException("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % pluginVersion) | ||
} |
13 changes: 13 additions & 0 deletions
13
src/sbt-test/specific-files/directories/scalastyle-config.xml
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,13 @@ | ||
<scalastyle> | ||
<name>Scalastyle standard configuration</name> | ||
<check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true"> | ||
<parameters> | ||
<parameter name="maxFileLength"><![CDATA[5]]></parameter> | ||
</parameters> | ||
</check> | ||
<check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true"> | ||
<parameters> | ||
<parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter> | ||
</parameters> | ||
</check> | ||
</scalastyle> |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/specific-files/directories/src/main/scala/package1/Example.scala
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,5 @@ | ||
class Example { | ||
def hello(): Unit = { | ||
println("hello") | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/specific-files/directories/src/main/scala/package2/hello.scala
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,9 @@ | ||
|
||
object Main extends App { | ||
println("hello") | ||
} | ||
|
||
object foo { | ||
println("hello") | ||
} | ||
|
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,4 @@ | ||
# scalastyle on specific files | ||
> clean | ||
> scalastyle src/main/scala/package1 | ||
> containsMessage |
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,16 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.10.0" | ||
|
||
val containsMessage = taskKey[Boolean]("contains message") | ||
|
||
containsMessage := { | ||
val search = "File length exceeds" | ||
val filename = "target/scalastyle-result.xml" | ||
val lines = sbt.IO.readLines(file(filename)) | ||
val contains = lines.find(s => s.contains(search)).isDefined | ||
if (contains) { | ||
sys.error("Found " + search + " in " + filename) | ||
} | ||
contains | ||
} |
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 @@ | ||
sbt.version=0.13.0 |
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,9 @@ | ||
resolvers += "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/" | ||
|
||
{ | ||
val pluginVersion = System.getProperty("plugin.version") | ||
if(pluginVersion == null) | ||
throw new RuntimeException("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % pluginVersion) | ||
} |
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,13 @@ | ||
<scalastyle> | ||
<name>Scalastyle standard configuration</name> | ||
<check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true"> | ||
<parameters> | ||
<parameter name="maxFileLength"><![CDATA[5]]></parameter> | ||
</parameters> | ||
</check> | ||
<check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true"> | ||
<parameters> | ||
<parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter> | ||
</parameters> | ||
</check> | ||
</scalastyle> |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/specific-files/files/src/main/scala/Example.scala
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,5 @@ | ||
class Example { | ||
def hello(): Unit = { | ||
println("hello") | ||
} | ||
} |
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,9 @@ | ||
|
||
object Main extends App { | ||
println("hello") | ||
} | ||
|
||
object foo { | ||
println("hello") | ||
} | ||
|
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,4 @@ | ||
# scalastyle on specific files | ||
> clean | ||
> scalastyle src/main/scala/Example.scala | ||
> containsMessage |
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,16 @@ | ||
version := "0.1" | ||
|
||
scalaVersion := "2.10.0" | ||
|
||
val containsMessage = taskKey[Boolean]("contains message") | ||
|
||
containsMessage := { | ||
val search = "File length exceeds" | ||
val filename = "target/scalastyle-result.xml" | ||
val lines = sbt.IO.readLines(file(filename)) | ||
val contains = lines.find(s => s.contains(search)).isDefined | ||
if (!contains) { | ||
sys.error("Could not find " + search + " in " + filename) | ||
} | ||
contains | ||
} |
1 change: 1 addition & 0 deletions
1
src/sbt-test/specific-files/nonexistent-file/project/build.properties
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 @@ | ||
sbt.version=0.13.0 |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/specific-files/nonexistent-file/project/plugins.sbt
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,9 @@ | ||
resolvers += "sonatype-snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/" | ||
|
||
{ | ||
val pluginVersion = System.getProperty("plugin.version") | ||
if(pluginVersion == null) | ||
throw new RuntimeException("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else addSbtPlugin("org.scalastyle" % "scalastyle-sbt-plugin" % pluginVersion) | ||
} |
13 changes: 13 additions & 0 deletions
13
src/sbt-test/specific-files/nonexistent-file/scalastyle-config.xml
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,13 @@ | ||
<scalastyle> | ||
<name>Scalastyle standard configuration</name> | ||
<check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true"> | ||
<parameters> | ||
<parameter name="maxFileLength"><![CDATA[5]]></parameter> | ||
</parameters> | ||
</check> | ||
<check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true"> | ||
<parameters> | ||
<parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter> | ||
</parameters> | ||
</check> | ||
</scalastyle> |
5 changes: 5 additions & 0 deletions
5
src/sbt-test/specific-files/nonexistent-file/src/main/scala/Example.scala
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,5 @@ | ||
class Example { | ||
def hello(): Unit = { | ||
println("hello") | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/sbt-test/specific-files/nonexistent-file/src/main/scala/hello.scala
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,9 @@ | ||
|
||
object Main extends App { | ||
println("hello") | ||
} | ||
|
||
object foo { | ||
println("hello") | ||
} | ||
|
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,5 @@ | ||
# scalastyle on specific files | ||
> clean | ||
# simulated typo | ||
> scalastyle src/main/scala/Eaxmple.scala | ||
> containsMessage |
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