Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the laserdisc defaults plugin #1

Merged
merged 6 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@v5
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
55 changes: 13 additions & 42 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,44 +1,15 @@
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"
ThisBuild / coverageEnabled := true

val root = (project in file("."))
.settings(
name := "console4s",
developers := List(LaserDiscDevelopers.Barry),
Dependencies.Testing,

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)
)
.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
5 changes: 2 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
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.scoverage" % "sbt-scoverage" % "2.2.2")
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