Skip to content

Commit 209b6c4

Browse files
authored
Fork project from Etsy repo (#1)
1 parent 58b5c5f commit 209b6c4

File tree

17 files changed

+118
-112
lines changed

17 files changed

+118
-112
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
java: [8, 11]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: coursier/cache-action@v6
19+
- uses: actions/setup-java@v2
20+
with:
21+
java-version: ${{matrix.java}}
22+
distribution: temurin
23+
- name: Run tests
24+
run: sbt test scripted scalastyle

.travis.yml

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

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2016 Etsy
3+
Copyright (c) 2014-2022 Etsy
4+
Copyright (c) 2022- Michael Stringer
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,35 @@
1-
# sbt-checkstyle-plugin [![Build Status](https://travis-ci.org/etsy/sbt-checkstyle-plugin.svg?branch=master)](https://travis-ci.org/etsy/sbt-checkstyle-plugin)
1+
# sbt-checkstyle-plugin
22

3-
This project provides an SBT 0.13+ and 1.x plugin for running Checkstyle over
4-
Java source files. For more information about Checkstyle, see
5-
[http://checkstyle.sourceforge.net/](http://checkstyle.sourceforge.net/)
3+
This project provides an sbt plugin for running Checkstyle over Java source files. For more information about
4+
Checkstyle, see [checkstyle.sourceforge.io](http://checkstyle.sourceforge.io).
65

7-
This plugin uses version 6.15 of Checkstyle.
6+
This plugin uses version 6.15 of Checkstyle by default.
87

9-
This is a fork of the sbt-code-quality project found
10-
[here](https://github.com/corux/sbt-code-quality).
8+
This project was forked from [etsy/sbt-checkstyle-plugin](https://github.com/etsy/sbt-checkstyle-plugin) in 2022
9+
after it became unmaintained. Some initial code was based on an
10+
[earlier plugin](https://github.com/corux/sbt-code-quality) (dead link).
1111

1212
## Setup
1313

1414
Add the following lines to `project/plugins.sbt`:
1515

1616
```scala
17-
addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % "3.1.1")
17+
addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % "<version>")
1818
```
1919

2020
sbt-checkstyle-plugin is an AutoPlugin, so there is no need to modify the `build.sbt` file to enable it.
2121

2222
## Usage
2323

24-
You can run Checkstyle over your Java source files with the
25-
`checkstyle` task. You can run Checkstyle over your Java tests with
26-
the `test:checkstyle` task.
24+
You can run Checkstyle over your Java source files with the `checkstyle` task. You can run Checkstyle over your Java
25+
tests with the `test:checkstyle` task.
2726

28-
The Checkstyle configuration file is `./checkstyle-config.xml` by
29-
default. This can be changed by setting the value of
30-
`checkstyleConfigLocation`. By default `test:checkstyle` uses the same
31-
configuration file, but this can be changed by setting the value of
32-
`checkstyleConfigLocation in Test`.
27+
The Checkstyle configuration file is `./checkstyle-config.xml` by default. This can be changed by setting the value of
28+
`checkstyleConfigLocation`. By default `test:checkstyle` uses the same configuration file, but this can be changed by
29+
setting the value of `checkstyleConfigLocation in Test`.
3330

34-
The Checkstyle report is output to `target/checkstyle-report.xml` by
35-
default. This can be changed by setting the value of
36-
`checkstyleOutputFile`. `test:checkstyle` outputs to
37-
`target/checkstyle-test-report.xml`, but this can be changed by
31+
The Checkstyle report is output to `target/checkstyle-report.xml` by default. This can be changed by setting the value
32+
of `checkstyleOutputFile`. `test:checkstyle` outputs to `target/checkstyle-test-report.xml`, but this can be changed by
3833
setting the value of `checkstyleOutputFile in Test`.
3934

4035
To change the checkstyle configuration file set `checkstyleConfigLocation` in `build.sbt`:
@@ -65,7 +60,9 @@ To run Checkstyle automatically after test compilation:
6560

6661
### XSLT transformations
6762

68-
The `checkstyleXsltTransformations` setting allows applying XSLT transformations to the XML report generated by Checkstyle. For instance, this could be used to generate a more readable HTML report. This setting takes values of `Option[Set[XSLTSettings]]`, so multiple transformations can be applied.
63+
The `checkstyleXsltTransformations` setting allows applying XSLT transformations to the XML report generated by
64+
Checkstyle. For instance, this could be used to generate a more readable HTML report. This setting takes values of
65+
`Option[Set[XSLTSettings]]`, so multiple transformations can be applied.
6966

7067
You can set `checkstyleXsltTransformations` like so in `build.sbt`:
7168
```scala
@@ -76,7 +73,8 @@ checkstyleXsltTransformations := {
7673

7774
### Failing the build
7875

79-
You can control what severity of issues should break the build by setting the `checkstyleSeverityLevel` in your `build.sbt` as follows:
76+
You can control what severity of issues should break the build by setting the `checkstyleSeverityLevel` in your
77+
`build.sbt` as follows:
8078
```scala
8179
checkstyleSeverityLevel := Some(CheckstyleSeverityLevel.Error)
8280
```
@@ -100,9 +98,10 @@ You can then run the tasks `it:checkstyle` and `it:checkstyle-check`.
10098

10199
### Upgrading Checkstyle version
102100

103-
SBT Checkstyle plugin comes with a default Checkstyle version: currently, Checkstyle 6.15 is used by default.
101+
sbt Checkstyle plugin comes with a default Checkstyle version: currently, Checkstyle 6.15 is used by default.
104102

105-
Provided the new Checkstyle version is compatible, you can override the version used at runtime in your `project/plugins.sbt`:
103+
Provided the new Checkstyle version is compatible, you can override the version used at runtime in your
104+
`project/plugins.sbt`:
106105

107106
```scala
108107
dependencyOverrides += "com.puppycrawl.tools" % "checkstyle" % "6.15"

build.sbt

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name := "sbt-checkstyle-plugin"
2-
organization := "com.etsy"
2+
organization := "software.purpledragon"
33

4-
version := "3.1.2-SNAPSHOT"
4+
version := "3.2.0"
55

66
sbtPlugin := true
7-
crossSbtVersions := Seq("0.13.16", "1.1.0")
87

98
libraryDependencies ++= Seq(
109
"com.puppycrawl.tools" % "checkstyle" % "6.15",
@@ -14,29 +13,19 @@ libraryDependencies ++= Seq(
1413
"com.github.stefanbirkner" % "system-rules" % "1.6.0" % "test"
1514
)
1615

17-
xerial.sbt.Sonatype.sonatypeSettings
18-
publishTo := sonatypePublishTo.value
19-
20-
pomExtra := <url>https://github.com/etsy/sbt-checkstyle-plugin</url>
21-
<licenses>
22-
<license>
23-
<name>MIT License</name>
24-
<url>http://opensource.org/licenses/MIT</url>
25-
<distribution>repo</distribution>
26-
</license>
27-
</licenses>
28-
<scm>
29-
<url>git@github.com:etsy/sbt-checkstyle-plugin.git</url>
30-
<connection>scm:git:git@github.com:etsy/sbt-checkstyle-plugin.git</connection>
31-
</scm>
32-
<developers>
33-
<developer>
34-
<id>ajsquared</id>
35-
<name>Andrew Johnson</name>
36-
<url>github.com/ajsquared</url>
37-
</developer>
38-
</developers>
16+
licenses += ("MIT", url("https://opensource.org/licenses/MIT"))
3917

40-
scalastyleConfig := file("scalastyle.xml")
18+
publishTo := sonatypePublishToBundle.value
19+
20+
developers := List(
21+
Developer("stringbean", "Michael Stringer", "@the_stringbean", url("https://github.com/stringbean"))
22+
)
4123

24+
homepage := Some(url("https://github.com/stringbean/sbt-checkstyle-plugin"))
25+
scmInfo := Some(
26+
ScmInfo(
27+
url("https://github.com/stringbean/sbt-checkstyle-plugin"),
28+
"https://github.com/stringbean/sbt-checkstyle-plugin.git"))
29+
30+
scalastyleConfig := file("scalastyle.xml")
4231
scalastyleFailOnError := true

project/plugins.sbt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.1")
2-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
1+
// publishing
2+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
3+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
4+
5+
// code style
36
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
77
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
7-
}
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
7+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
7-
}
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
7+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
7-
}
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
7+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
7-
}
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
7+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
7-
}
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
7+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
77
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
77
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
77
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
77
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
val pluginVersion = System.getProperty("plugin.version")
3-
if(pluginVersion == null)
4-
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6-
else addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % pluginVersion)
6+
else addSbtPlugin("software.purpledragon" % "sbt-checkstyle-plugin" % pluginVersion)
77
}

0 commit comments

Comments
 (0)