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

Bump actions/checkout from 3 to 4 #1

Open
wants to merge 75 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
93203e1
Include field names in rendering of Product (Scala 2.13 only)
cb372 Mar 25, 2020
5b75491
backup
yilinwei May 19, 2020
e5eaf1c
backup
yilinwei Jul 29, 2020
b1c6332
Merge pull request #38 from cb372/product-element-names
lihaoyi Jul 31, 2020
8258a74
fix wrapping on named fields and add tests
lihaoyi Jul 31, 2020
72d930a
0.6.0
lihaoyi Jul 31, 2020
eaa14e1
See if CI has same issue
yilinwei Aug 3, 2020
3a3cbd1
Add tests back in
yilinwei Aug 5, 2020
8e38755
Delete TPrintTests.scala~
yilinwei Aug 5, 2020
ca602c3
Update TPrintTests.scala
yilinwei Aug 5, 2020
731faa0
Update AdvancedTests.scala
yilinwei Aug 5, 2020
0d111e4
Update AdvancedTests.scala
yilinwei Aug 5, 2020
55433a4
Apply suggestions from code review
yilinwei Aug 5, 2020
51abe98
Update pprint/src-0/TPrintImpl.scala
yilinwei Aug 5, 2020
9e44001
Add the dotty environment variable
yilinwei Aug 5, 2020
2a22466
Address Nicolas's comments
yilinwei Aug 5, 2020
5a0ebd4
Merge branch 'master' of github.com:lihaoyi/PPrint
yilinwei Aug 5, 2020
061f6ae
Fix constructor for dotty
yilinwei Aug 5, 2020
7ea3c1e
Merge pull request #41 from yilinwei/master
anatoliykmetyuk Aug 6, 2020
5f9e4d5
Bump Dotty to 0.27.0-RC1
anatoliykmetyuk Aug 28, 2020
2b0a95e
Fix printing of annotated type
tgodzik Sep 1, 2020
6c62919
Merge pull request #46 from tgodzik/fix-annotated-type
lihaoyi Sep 3, 2020
960a298
Bump Dotty to 0.27.0-RC1
anatoliykmetyuk Sep 17, 2020
a1ad168
Merge pull request #48 from lihaoyi/bump-dotty
anatoliykmetyuk Sep 17, 2020
6560f7a
Merge branch 'master' into dotty-community-build
anatoliykmetyuk Sep 18, 2020
df35390
Update metaprogramming to the latest Dotty API
anatoliykmetyuk Sep 18, 2020
46eb823
Remove Scala 2 macro deps from Scala 3 project
anatoliykmetyuk Sep 22, 2020
95136d9
Migrate to Scala 3.0.0-M1
anatoliykmetyuk Oct 13, 2020
73353ed
Rename: src-0 -> src-3
anatoliykmetyuk Oct 13, 2020
4a135e4
Rename Reflection.Type to TypeRepr
nicolasstucki Oct 26, 2020
ee55dc3
Remove deprecated tasty member
nicolasstucki Nov 4, 2020
bb3f91f
Contextualize Type
nicolasstucki Nov 7, 2020
bf98e5f
Bump Dotty to Scala 3.0.0-M1
anatoliykmetyuk Nov 16, 2020
cd3ccb0
Update QuoteContext to Quotes
nicolasstucki Nov 22, 2020
05aae07
Use quotes alias
nicolasstucki Nov 23, 2020
5ef9cc2
Merge remote-tracking branch 'origin/use-quotes-given-alias' into dot…
anatoliykmetyuk Nov 25, 2020
2a702bf
Bump Dotty to M2
anatoliykmetyuk Nov 25, 2020
94f9f4a
Merge pull request #49 from dotty-staging/dotty-community-build
anatoliykmetyuk Nov 26, 2020
7ee2168
Update Scala Native to 0.4.0
lolgab Jan 23, 2021
4f5bcdc
Update Scala 3.0.0-M3 syntax
lolgab Jan 28, 2021
5279faf
Fix macro on Scala 2.13
lolgab Jan 28, 2021
d8f1806
Merge pull request #52 from lolgab/update-scala-native-0.4.0
lihaoyi Jan 28, 2021
3704f26
Upgrade to Scala 3.0.0-RC1
nicolasstucki Dec 2, 2020
126a33f
Merge pull request #54 from dotty-staging/backprop
anatoliykmetyuk Feb 24, 2021
0cc1081
Add Github actions, publishVersion from git tag
lolgab Mar 7, 2021
89252ec
Merge pull request #56 from com-lihaoyi/add-github-actions
lolgab Mar 7, 2021
3c2aadf
Support Scala 3 on Scala.js
lolgab Mar 7, 2021
8da5718
Merge pull request #57 from com-lihaoyi/scala-js-scala3
lolgab Mar 7, 2021
85f33dc
Publish for Scala 2.11
lolgab Mar 25, 2021
38825ee
Merge pull request #60 from com-lihaoyi/publish-scala-2.11
lolgab Mar 25, 2021
c8f0470
Bump scala version
jodersky Apr 1, 2021
069bae1
Upgrade Dotty to 3.0.0-RC3
anatoliykmetyuk Apr 28, 2021
8613a8d
Merge pull request #62 from dotty-staging/scala3-release-3.0.0-RC3
jodersky Apr 28, 2021
9f27075
Create release on GitHub when releasing to Maven
anatoliykmetyuk Apr 28, 2021
05fc94d
Merge pull request #61 from dotty-staging/ci-releases
anatoliykmetyuk May 4, 2021
669055b
Support Scala 3.0.0
lolgab May 15, 2021
6d19aa6
Merge pull request #65 from com-lihaoyi/support-scala-3
lolgab May 15, 2021
7fb36e5
Update Documentation link (#67)
lolgab Jun 28, 2021
1b3276e
Run tests in CI again (#68)
lolgab Jul 16, 2021
780fe6c
Add mill-mima to check binary compatibility (#69)
lolgab Jul 28, 2021
dbb43b5
Updated link to documentation. (#66)
martingd Oct 6, 2021
2af8020
Make pprint robust against toString method returning null #70
lihaoyi Nov 29, 2021
dbfd5da
Add a flag to disable unicode escaping, refactor showFieldNames confi…
lihaoyi Nov 30, 2021
2e335c8
Fix pprint for Product2 (#36)
karolchmist Dec 3, 2021
6a270d1
Fix link to documentation (#58)
angelcervera Dec 6, 2021
7fead8d
Overhaul and simplify TPrint implementation (#72)
lihaoyi Dec 6, 2021
21fdfdf
Release PPrint 0.7.0 #73
lihaoyi Dec 11, 2021
0a8c900
Fix PPrinting of booleans and TPrinting of constant types (#75)
lihaoyi Dec 13, 2021
a1ddeb7
0.7.1
lihaoyi Dec 13, 2021
3abeed8
Add pprint.err.log (#74)
alexarchambault Dec 21, 2021
f24db51
Support Scala 3 - Scala Native (#77)
lolgab Mar 4, 2022
2626e05
Add support for Polytypes (#79)
valencik Mar 27, 2022
2cd41af
Update Version History
lolgab Mar 27, 2022
2203dc6
deps: update all sorts of stuff (#82)
ckipp01 Jul 12, 2022
5d69662
Bump actions/checkout from 3 to 4
dependabot[bot] Oct 1, 2023
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
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
82 changes: 82 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: ci

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['8', '17']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Run tests
run: ./mill -i all __.publishArtifacts __.test

check-binary-compatibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Check Binary Compatibility
run: ./mill -i __.mimaReportBinaryIssues

publish-sonatype:
if: github.repository == 'com-lihaoyi/PPrint' && contains(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
env:
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Publish to Maven Central
run: |
if [[ $(git tag --points-at HEAD) != '' ]]; then
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key
gpg --import --no-tty --batch --yes gpg_key
rm gpg_key
./mill -i mill.scalalib.PublishModule/publishAll \
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
--publishArtifacts __.publishArtifacts \
--readTimeout 600000 \
--awaitTimeout 600000 \
--release true \
--signed true
fi
- name: Create GitHub Release
id: create_gh_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ target/
project/.sbtserver
tags
nohup.out
.bloop/
.metals/
.vscode/
1 change: 1 addition & 0 deletions .mill-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.10.5
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PPrint [![Gitter Chat][gitter-badge]][gitter-link] [![Build Status][travis-badge]][travis-link]
PPrint [![Gitter Chat][gitter-badge]][gitter-link]
===============================================================================================

[travis-badge]: https://travis-ci.org/lihaoyi/PPrint.svg
Expand All @@ -9,4 +9,4 @@ PPrint [![Gitter Chat][gitter-badge]][gitter-link] [![Build Status][travis-badge

*A Scala library to pretty-print values and types*

[Documentation](https://lihaoyi.github.io/PPrint/)
[Documentation](https://com-lihaoyi.github.io/PPrint/)
98 changes: 42 additions & 56 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._
import mill.scalalib.api.Util.isScala3
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.1.4`
import de.tobiasroeser.mill.vcs.version.VcsVersion
import $ivy.`com.github.lolgab::mill-mima::0.0.11`
import com.github.lolgab.mill.mima._

val dottyCommunityBuildVersion = sys.props.get("dottyVersion").toList

trait PPrintModule extends PublishModule {
val scalaVersions =
"2.12.16" :: "2.13.8" :: "2.11.12" :: "3.1.3" :: dottyCommunityBuildVersion

val scalaJSVersions = scalaVersions.map((_, "1.10.1"))
val scalaNativeVersions = scalaVersions.map((_, "0.4.5"))

trait PPrintModule extends PublishModule with Mima {
def artifactName = "pprint"

def publishVersion = "0.5.9"
def publishVersion = VcsVersion.vcsState().format()

def mimaPreviousVersions = VcsVersion.vcsState().lastTag.toSeq

def crossScalaVersion: String

// Temporary until the next version of Mima gets released with
// https://github.com/lightbend/mima/issues/693 included in the release.
def mimaPreviousArtifacts =
if(isScala3(crossScalaVersion)) Agg.empty[Dep] else super.mimaPreviousArtifacts()

def pomSettings = PomSettings(
description = artifactName(),
organization = "com.lihaoyi",
url = "https://github.com/lihaoyi/PPrint",
url = "https://github.com/com-lihaoyi/PPrint",
licenses = Seq(License.MIT),
scm = SCM(
"git://github.com/lihaoyi/PPrint.git",
"scm:git://github.com/lihaoyi/PPrint.git"
versionControl = VersionControl.github(
owner = "com-lihaoyi",
repo = "PPrint"
),
developers = Seq(
Developer("lihaoyi", "Li Haoyi", "https://github.com/lihaoyi")
Expand All @@ -23,13 +44,15 @@ trait PPrintModule extends PublishModule {
trait PPrintMainModule extends CrossScalaModule {
def millSourcePath = super.millSourcePath / offset
def ivyDeps = Agg(
ivy"com.lihaoyi::fansi::0.2.9",
ivy"com.lihaoyi::sourcecode::0.2.1"
)
def compileIvyDeps = Agg(
ivy"org.scala-lang:scala-reflect:${scalaVersion()}",
ivy"org.scala-lang:scala-compiler:${scalaVersion()}"
ivy"com.lihaoyi::fansi::0.4.0",
ivy"com.lihaoyi::sourcecode::0.3.0"
)
def compileIvyDeps =
if (crossScalaVersion.startsWith("2")) Agg(
ivy"${scalaOrganization()}:scala-reflect:${scalaVersion()}",
ivy"${scalaOrganization()}:scala-compiler:${scalaVersion()}"
)
else Agg.empty[Dep]
def offset: os.RelPath = os.rel
def sources = T.sources(
super.sources()
Expand All @@ -40,46 +63,12 @@ trait PPrintMainModule extends CrossScalaModule {
)
)
)
def generatedSources = T{
val dir = T.ctx().dest
val file = dir/"pprint"/"TPrintGen.scala"

val typeGen = for(i <- 2 to 22) yield {
val ts = (1 to i).map("T" + _).mkString(", ")
val tsBounded = (1 to i).map("T" + _ + ": Type").mkString(", ")
val tsGet = (1 to i).map("get[T" + _ + "](cfg)").mkString(" + \", \" + ")
s"""
implicit def F${i}TPrint[$tsBounded, R: Type] = make[($ts) => R](cfg =>
"(" + $tsGet + ") => " + get[R](cfg)
)
implicit def T${i}TPrint[$tsBounded] = make[($ts)](cfg =>
"(" + $tsGet + ")"
)
"""
}
val output = s"""
package pprint
trait TPrintGen[Type[_], Cfg]{
def make[T](f: Cfg => String): Type[T]
def get[T: Type](cfg: Cfg): String
implicit def F0TPrint[R: Type] = make[() => R](cfg => "() => " + get[R](cfg))
implicit def F1TPrint[T1: Type, R: Type] = {
make[T1 => R](cfg => get[T1](cfg) + " => " + get[R](cfg))
}
${typeGen.mkString("\n")}
}
""".stripMargin
os.write(file, output, createFolders = true)
Seq(PathRef(file))
}

}


trait PPrintTestModule extends ScalaModule with TestModule {
trait PPrintTestModule extends ScalaModule with TestModule.Utest {
def crossScalaVersion: String
def testFrameworks = Seq("utest.runner.Framework")
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.7.4")
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.0")
def offset: os.RelPath = os.rel
def millSourcePath = super.millSourcePath / os.up

Expand All @@ -97,20 +86,18 @@ trait PPrintTestModule extends ScalaModule with TestModule {
}

object pprint extends Module {
object jvm extends Cross[JvmPPrintModule]("2.12.8", "2.13.0")
object jvm extends Cross[JvmPPrintModule](scalaVersions:_*)
class JvmPPrintModule(val crossScalaVersion: String)
extends PPrintMainModule with ScalaModule with PPrintModule {
object test extends Tests with PPrintTestModule{
val crossScalaVersion = JvmPPrintModule.this.crossScalaVersion
}
}

object js extends Cross[JsPPrintModule](
("2.12.8", "0.6.31"), ("2.13.0", "0.6.31"),
("2.12.8", "1.0.0"), ("2.13.0", "1.0.0")
)
object js extends Cross[JsPPrintModule](scalaJSVersions:_*)
class JsPPrintModule(val crossScalaVersion: String, crossJSVersion: String)
extends PPrintMainModule with ScalaJSModule with PPrintModule {

def offset = os.up
def scalaJSVersion = crossJSVersion
object test extends Tests with PPrintTestModule{
Expand All @@ -119,9 +106,7 @@ object pprint extends Module {
}
}

object native extends Cross[NativePPrintModule](
("2.11.12", "0.3.9"), ("2.11.12", "0.4.0-M2")
)
object native extends Cross[NativePPrintModule](scalaNativeVersions:_*)
class NativePPrintModule(val crossScalaVersion: String, crossScalaNativeVersion: String)
extends PPrintMainModule with ScalaNativeModule with PPrintModule {
def offset = os.up
Expand All @@ -131,4 +116,5 @@ object pprint extends Module {
val crossScalaVersion = NativePPrintModule.this.crossScalaVersion
}
}

}
11 changes: 6 additions & 5 deletions mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# This is a wrapper script, that automatically download mill from GitHub release pages
# You can give the required mill version with MILL_VERSION env variable
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
DEFAULT_MILL_VERSION=0.6.1
DEFAULT_MILL_VERSION=0.10.5

set -e

if [ -z "$MILL_VERSION" ] ; then
if [ -f ".mill-version" ] ; then
MILL_VERSION="$(head -n 1 .mill-version 2> /dev/null)"
elif [ -f "mill" ] && [ "$BASH_SOURCE" != "mill" ] ; then
elif [ -f "mill" ] && [ "$0" != "mill" ] ; then
MILL_VERSION=$(grep -F "DEFAULT_MILL_VERSION=" "mill" | head -n 1 | cut -d= -f2)
else
MILL_VERSION=$DEFAULT_MILL_VERSION
Expand All @@ -28,13 +28,14 @@ version_remainder="$MILL_VERSION"
MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"

if [ ! -x "$MILL_EXEC_PATH" ] ; then
mkdir -p $MILL_DOWNLOAD_PATH
if [ ! -s "$MILL_EXEC_PATH" ] ; then
mkdir -p "$MILL_DOWNLOAD_PATH"
if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then
ASSEMBLY="-assembly"
fi
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION${ASSEMBLY}"
MILL_VERSION_TAG=$(echo $MILL_VERSION | sed -E 's/([^-]+)(-M[0-9]+)?(-.*)?/\1\2/')
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION_TAG}/$MILL_VERSION${ASSEMBLY}"
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
chmod +x "$DOWNLOAD_FILE"
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"
Expand Down
11 changes: 11 additions & 0 deletions pprint/src-2.11/pprint/ProductSupport.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package pprint

object ProductSupport {

def treeifyProductElements(x: Product,
walker: Walker,
escapeUnicode: Boolean,
showFieldNames: Boolean): Iterator[Tree] =
x.productIterator.map(x => walker.treeify(x, escapeUnicode, showFieldNames))

}
11 changes: 11 additions & 0 deletions pprint/src-2.12/pprint/ProductSupport.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package pprint

object ProductSupport {

def treeifyProductElements(x: Product,
walker: Walker,
escapeUnicode: Boolean,
showFieldNames: Boolean): Iterator[Tree] =
x.productIterator.map(x => walker.treeify(x, escapeUnicode, showFieldNames))

}
19 changes: 19 additions & 0 deletions pprint/src-2.13/pprint/ProductSupport.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package pprint

object ProductSupport {

def treeifyProductElements(x: Product,
walker: Walker,
escapeUnicode: Boolean,
showFieldNames: Boolean): Iterator[Tree] = {
if (!showFieldNames) x.productIterator.map(x => walker.treeify(x, escapeUnicode, showFieldNames))
else x.productElementNames
.zipWithIndex
.map {
case (name, i) =>
val elem = x.productElement(i)
Tree.KeyValue(name, walker.treeify(elem, escapeUnicode, showFieldNames))
}
}

}
2 changes: 1 addition & 1 deletion pprint/src-2.13/pprint/StringPrefix.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package pprint

object StringPrefix{
def apply(i: Iterable[_]) = i.asInstanceOf[{ def collectionClassName: String }].collectionClassName
}
}
Loading
Loading