Skip to content

Commit

Permalink
use the laserdisc defaults plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
barryoneill committed Nov 26, 2024
1 parent 32e6b3c commit f0682e1
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 99 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build
on:
pull_request:
branches:
- '*'
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Branch Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Java And Sbt
uses: olafurpg/setup-scala@v14
with:
java-version: [email protected]
- name: Cache
uses: actions/cache@v4
with:
path: |
$HOME/.cache/coursier
$HOME/.ivy2/cache
$HOME/.sbt
key: ${{ runner.os }}-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Build
run: sbt build
- name: Upload To Codecov
uses: codecov/codecov-action@v2
45 changes: 0 additions & 45 deletions .github/workflows/ci.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v13
- uses: olafurpg/setup-scala@v14
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# ------------------ autogenerated file - do not edit -------------------
# This file was generated by sbt-laserdisc-defaults
#
# Please check in any changes generated in this file (for IDE support)
#
# To make changes, please publish a new version of the plugin at:
# https://github.com/laserdisc-io/sbt-laserdisc-defaults
#
# To temporarily disable generation, set this at the top of build.sbt:
# ThisBuild / laserdiscGitIgnoreGenOn := false
# -----------------------------------------------------------------------

# tip: use a "global" gitignore (core.excludesfile) for your own, local, personal preferences
# See: https://gist.github.com/subfuzion/db7f57fff2fb6998a16c

# scala / sbt / java
project/project/
Expand Down
19 changes: 16 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
version=3.6.1
# ------------------ autogenerated file - do not edit -------------------
# This file was generated by sbt-laserdisc-defaults
#
# Please check in any changes generated in this file (for IDE support)
#
# To make changes, please publish a new version of the plugin at:
# https://github.com/laserdisc-io/sbt-laserdisc-defaults
#
# To temporarily disable generation, set this at the top of build.sbt:
# ThisBuild / laserdiscScalaFmtGenOn := false
# -----------------------------------------------------------------------

version=3.8.3

maxColumn = 140
style = default
align.preset = more

runner.dialect = scala213source3
project.layout = StandardConvention
runner.dialect = scala3
fileOverride {
"glob:**/scala-3.0+/**" { runner.dialect = scala3 }
"lang:scala-2" = scala213source3
}

danglingParentheses.preset = true
Expand Down
53 changes: 11 additions & 42 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,44 +1,13 @@
ThisBuild / scalaVersion := "2.13.10"
import laserdisc.sbt.CompileTarget.Scala2And3
import laserdisc.sbt.LaserDiscDevelopers

lazy val publishSettings = Seq(
Test / publishArtifact := false,
pomIncludeRepository := (_ => false),
organization := "io.laserdisc",
homepage := Some(url("http://laserdisc.io/console4s")),
developers := List(Developer("barryoneill", "Barry O'Neill", "", url("https://github.com/barryoneill"))),
licenses := Seq("MIT" -> url("https://raw.githubusercontent.com/laserdisc-io/console4s/master/LICENSE")),
scmInfo := Some(
ScmInfo(
url("https://github.com/laserdisc-io/console4s/tree/master"),
"scm:git:[email protected]:laserdisc-io/console4s.git",
"scm:git:[email protected]:laserdisc-io/console4s.git"
)
)
)
ThisBuild / laserdiscCompileTarget := Scala2And3
ThisBuild / laserdiscRepoName := "console4s"

val root =
(project in file("."))
.settings(
name := "console4s",
Dependencies.Testing,
publishSettings,
Seq(
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"),
scalacOptions ++= Seq(
"-encoding",
"UTF-8",
"-deprecation",
"-unchecked",
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-Xlint:_,-byname-implicit",
"-Xfatal-warnings"
)
),
addCommandAlias("format", ";scalafmtAll;scalafmtSbt"),
addCommandAlias("checkFormat", ";scalafmtCheckAll;scalafmtSbtCheck"),
addCommandAlias("fullTest", ";clean;checkFormat;test")
)
.enablePlugins(GitVersioning)
val root = (project in file("."))
.settings(
name := "console4s",
developers := List(LaserDiscDevelopers.Barry),
Dependencies.Testing
)
.enablePlugins(LaserDiscDefaultsPlugin)
14 changes: 13 additions & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
sbt.version = 1.8.0
# ------------------ autogenerated file - do not edit -------------------
# This file was generated by sbt-laserdisc-defaults
#
# Please check in any changes generated in this file (for IDE support)
#
# To make changes, please publish a new version of the plugin at:
# https://github.com/laserdisc-io/sbt-laserdisc-defaults
#
# To temporarily disable generation, set this at the top of build.sbt:
# ThisBuild / laserdiscSBTVersionGenOn := false
# -----------------------------------------------------------------------

sbt.version = 1.10.5
7 changes: 4 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
//addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
//addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
//addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("io.laserdisc" % "sbt-laserdisc-defaults" % "0.1.1")
6 changes: 4 additions & 2 deletions src/main/scala/io/laserdisc/console4s/tree/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ package object tree {
.mkString("")

val extraLinePrefix =
s"$prefix${pos.childToken}${config.blank * (config.nodeWidth + 1)}${if (numChildren > 0) config.pipe + (config.blank * 2)
else config.empty}"
s"$prefix${pos.childToken}${config.blank * (config.nodeWidth + 1)}${
if (numChildren > 0) config.pipe + (config.blank * 2)
else config.empty
}"

val contents: String =
nc.show(node).split("\\n").toList match {
Expand Down

0 comments on commit f0682e1

Please sign in to comment.