-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Update rubocop to 1.9.1 :breaking:
- Remove outdated rubocop-github - Move docker creation completely inside Dockerfile - Move docs in /docs instead of /src/main/resources/docs
- Loading branch information
Showing
793 changed files
with
7,801 additions
and
1,163 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,11 @@ | ||
# Ignore everything | ||
** | ||
|
||
# Allow files and directories | ||
!/Gemfile* | ||
!/target/universal/stage | ||
!/docs | ||
|
||
# Ignore unnecessary files inside allowed directories | ||
# This should go after the allowed directories | ||
**/.DS_Store |
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,2 +1,2 @@ | ||
src/main/resources/docs/description/* linguist-generated=true | ||
src/main/resources/docs/tool-description.md linguist-generated=true | ||
docs/description/* linguist-generated=true | ||
docs/tool-description.md linguist-generated=true |
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
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 |
---|---|---|
@@ -1,70 +1,12 @@ | ||
import com.typesafe.sbt.packager.docker.Cmd | ||
import sjsonnew.BasicJsonProtocol._ | ||
import sjsonnew._ | ||
import sjsonnew.support.scalajson.unsafe._ | ||
|
||
name := "codacy-rubocop" | ||
|
||
scalaVersion := "2.13.1" | ||
scalaVersion := "2.13.4" | ||
|
||
libraryDependencies ++= Seq( | ||
"org.scala-lang.modules" %% "scala-xml" % "1.2.0" withSources (), | ||
"com.codacy" %% "codacy-engine-scala-seed" % "5.0.1", | ||
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.8.4", | ||
"org.scala-lang.modules" %% "scala-xml" % "1.3.0", | ||
"com.codacy" %% "codacy-engine-scala-seed" % "5.0.3", | ||
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.12.1", | ||
"com.typesafe.play" %% "play-json" % "2.8.1" | ||
) | ||
|
||
enablePlugins(JavaAppPackaging) | ||
|
||
enablePlugins(DockerPlugin) | ||
|
||
lazy val toolVersion = settingKey[String]("The version of the underlying tool retrieved from patterns.json") | ||
|
||
toolVersion := { | ||
case class Patterns(name: String, version: String) | ||
implicit val patternsIso: IsoLList[Patterns] = | ||
LList.isoCurried((p: Patterns) => ("name", p.name) :*: ("version", p.version) :*: LNil) { | ||
case (_, n) :*: (_, v) :*: LNil => Patterns(n, v) | ||
} | ||
|
||
val jsonFile = (resourceDirectory in Compile).value / "docs" / "patterns.json" | ||
val json = Parser.parseFromFile(jsonFile) | ||
val patterns = json.flatMap(Converter.fromJson[Patterns]) | ||
patterns.get.version | ||
} | ||
|
||
mappings in Universal ++= (resourceDirectory in Compile).map { resourceDir: File => | ||
val src = resourceDir / "docs" | ||
val dest = "/docs" | ||
|
||
for { | ||
path <- src.allPaths.get if !path.isDirectory | ||
} yield path -> path.toString.replaceFirst(src.toString, dest) | ||
}.value | ||
|
||
val dockerUser = "docker" | ||
val dockerGroup = "docker" | ||
|
||
daemonUser in Docker := dockerUser | ||
daemonGroup in Docker := dockerGroup | ||
|
||
dockerBaseImage := "codacy-rubocop-base" | ||
|
||
mappings in Universal += file("scripts/doc_generate.sh") -> "scripts/doc_generate.sh" | ||
mappings in Universal += file("Gemfile") -> "Gemfile" | ||
mappings in Universal += file("doc_generation/codacy/rubocop/generator.rb") -> "doc_generation/codacy/rubocop/generator.rb" | ||
mappings in Universal += file("doc_generation/rubocop_doc/generator.rb") -> "doc_generation/rubocop_doc/generator.rb" | ||
|
||
dockerCommands := { | ||
dockerCommands.value.flatMap { | ||
case cmd @ (Cmd("ADD", _)) => | ||
Seq( | ||
Cmd("RUN", s"adduser -u 2004 -D $dockerUser"), | ||
cmd, | ||
Cmd("RUN", "sh scripts/doc_generate.sh $PWD"), | ||
Cmd("RUN", "apk del ruby-dev make gcc"), | ||
Cmd("RUN", "mv /opt/docker/docs /docs") | ||
) | ||
case other => Seq(other) | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
...docs/description/Bundler_DuplicatedGem.md → docs/description/Bundler_DuplicatedGem.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.