From 9b326c8a7b6f37acba000acadbd1bf43aead05d5 Mon Sep 17 00:00:00 2001 From: "lucuma-steward[bot]" <106720676+lucuma-steward[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 20:44:00 +0000 Subject: [PATCH 1/2] Update sbt-lucuma-lib to 0.11.2 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 3ccbae4e..46263d09 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,2 @@ -addSbtPlugin("edu.gemini" % "sbt-lucuma-lib" % "0.10.13") +addSbtPlugin("edu.gemini" % "sbt-lucuma-lib" % "0.11.2") addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4") From e1b124afe96556e26efae6fd8bff65fd0917f2a9 Mon Sep 17 00:00:00 2001 From: "lucuma-steward[bot]" <106720676+lucuma-steward[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 20:44:58 +0000 Subject: [PATCH 2/2] Run prePR with sbt-typelevel Executed command: sbt tlPrePrBotHook --- .github/workflows/ci.yml | 92 ++++++++----------- .mergify.yml | 8 +- .scalafmt-common.conf | 4 +- .../jts/algorithm/CGAlgorithmsDD.scala | 2 +- .../locationtech/jts/algorithm/Centroid.scala | 4 +- .../locationtech/jts/geom/Coordinate.scala | 4 +- .../locationtech/jts/geom/LineSegment.scala | 4 +- .../jts/geom/util/AffineTransformation.scala | 4 +- .../locationtech/jts/geomgraph/EdgeList.scala | 3 +- .../locationtech/jts/geomgraph/Quadrant.scala | 4 +- .../jts/index/strtree/AbstractSTRtree.scala | 2 +- .../scala/org/locationtech/jts/math/DD.scala | 9 +- .../org/locationtech/jts/noding/Octant.scala | 5 +- .../jts/operation/overlayng/LineBuilder.scala | 4 +- .../jts/operation/relate/EdgeEndBundle.scala | 11 +-- 15 files changed, 70 insertions(+), 90 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e5fbcd..d83b753a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,56 +15,42 @@ on: tags: [v*] env: - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +concurrency: + group: ${{ github.workflow }} @ ${{ github.ref }} + cancel-in-progress: true + jobs: build: name: Build and Test strategy: matrix: os: [ubuntu-latest] - scala: [3.2.2, 2.13.10] + scala: [3, 2.13] java: [temurin@17] project: [rootJS, rootJVM] runs-on: ${{ matrix.os }} + timeout-minutes: 60 steps: - name: Checkout current branch (full) uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Download Java (temurin@17) - id: download-java-temurin-17 - if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 17 - - name: Setup Java (temurin@17) + id: setup-java-temurin-17 if: matrix.java == 'temurin@17' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 17 - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + cache: sbt - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: sbt update + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update - run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'show coverageEnabled' @@ -75,6 +61,10 @@ jobs: if: matrix.java == 'temurin@17' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck lucumaScalafmtCheck lucumaScalafixCheck + - name: Check scalafix lints + if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest' + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'scalafixAll --check' + - name: scalaJSLink if: matrix.project == 'rootJS' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult @@ -82,14 +72,14 @@ jobs: - name: Test run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - - name: Check scalafix lints - if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest' - run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'scalafixAll --check' - - name: Check binary compatibility if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues + - name: Generate API documentation + if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest' + run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc + - name: Aggregate coverage reports run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' coverageReport coverageAggregate @@ -103,7 +93,6 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [3.2.2] java: [temurin@17] runs-on: ${{ matrix.os }} steps: @@ -112,44 +101,39 @@ jobs: with: fetch-depth: 0 - - name: Download Java (temurin@17) - id: download-java-temurin-17 - if: matrix.java == 'temurin@17' - uses: typelevel/download-java@v2 - with: - distribution: temurin - java-version: 17 - - name: Setup Java (temurin@17) + id: setup-java-temurin-17 if: matrix.java == 'temurin@17' uses: actions/setup-java@v3 with: - distribution: jdkfile + distribution: temurin java-version: 17 - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} + cache: sbt - - name: Cache sbt - uses: actions/cache@v3 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: sbt update + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' + run: sbt reload +update - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' + env: + PGP_SECRET: ${{ secrets.PGP_SECRET }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} run: echo $PGP_SECRET | base64 -di | gpg --import - name: Import signing key and strip passphrase if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' + env: + PGP_SECRET: ${{ secrets.PGP_SECRET }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} run: | echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - name: Publish - run: sbt '++ ${{ matrix.scala }}' tlCiRelease + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} + run: sbt tlCiRelease diff --git a/.mergify.yml b/.mergify.yml index 49ef909b..06f3f95f 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -13,10 +13,10 @@ pull_request_rules: - body~=labels:.*early-semver-patch - body~=labels:.*early-semver-minor - 'title=flake.lock: Update' - - status-success=Build and Test (ubuntu-latest, 3.2.2, temurin@17, rootJS) - - status-success=Build and Test (ubuntu-latest, 3.2.2, temurin@17, rootJVM) - - status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@17, rootJS) - - status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@17, rootJVM) + - status-success=Build and Test (ubuntu-latest, 3, temurin@17, rootJS) + - status-success=Build and Test (ubuntu-latest, 3, temurin@17, rootJVM) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@17, rootJS) + - status-success=Build and Test (ubuntu-latest, 2.13, temurin@17, rootJVM) actions: merge: {} - name: Label jts PRs diff --git a/.scalafmt-common.conf b/.scalafmt-common.conf index 0218680c..7b98c214 100644 --- a/.scalafmt-common.conf +++ b/.scalafmt-common.conf @@ -4,10 +4,10 @@ # this file by hand! Instead, if you wish to make changes, you should # make a PR to sbt-lucuma. -version = "3.7.2" +version = "3.7.7" style = default -runner.dialect = scala213source3 +runner.dialect = scala3 maxColumn = 100 project.git = true diff --git a/modules/jts/src/main/scala/org/locationtech/jts/algorithm/CGAlgorithmsDD.scala b/modules/jts/src/main/scala/org/locationtech/jts/algorithm/CGAlgorithmsDD.scala index c6ebbfdd..4a489d31 100644 --- a/modules/jts/src/main/scala/org/locationtech/jts/algorithm/CGAlgorithmsDD.scala +++ b/modules/jts/src/main/scala/org/locationtech/jts/algorithm/CGAlgorithmsDD.scala @@ -70,7 +70,7 @@ object CGAlgorithmsDD { * @return * 1 if q is counter-clockwise (left) from p1-p2 * @return - * -1 if q is clockwise (right) from p1-p2 + * -1 if q is clockwise (right) from p1-p2 * @return * 0 if q is collinear with p1-p2 */ diff --git a/modules/jts/src/main/scala/org/locationtech/jts/algorithm/Centroid.scala b/modules/jts/src/main/scala/org/locationtech/jts/algorithm/Centroid.scala index 0235232e..3ca8fd75 100644 --- a/modules/jts/src/main/scala/org/locationtech/jts/algorithm/Centroid.scala +++ b/modules/jts/src/main/scala/org/locationtech/jts/algorithm/Centroid.scala @@ -120,8 +120,8 @@ class Centroid(val geom: Geometry) { def getCentroid: Coordinate = { /** - * The centroid is computed from the highest dimension components present in the input. - * I.e. areas dominate lineal geometry, which dominates points. Degenerate geometry are computed + * The centroid is computed from the highest dimension components present in the input. I.e. + * areas dominate lineal geometry, which dominates points. Degenerate geometry are computed * using their effective dimension (e.g. areas may degenerate to lines or points) */ val cent = new Coordinate diff --git a/modules/jts/src/main/scala/org/locationtech/jts/geom/Coordinate.scala b/modules/jts/src/main/scala/org/locationtech/jts/geom/Coordinate.scala index 50dacff1..873c153e 100644 --- a/modules/jts/src/main/scala/org/locationtech/jts/geom/Coordinate.scala +++ b/modules/jts/src/main/scala/org/locationtech/jts/geom/Coordinate.scala @@ -375,8 +375,8 @@ class Coordinate(var x: Double, var y: Double, var z: Double) * * @param o * the Coordinate with which this Coordinate is being compared return - * -1, zero, or 1 as this Coordinate is less than, equal to, or greater than the - * specified Coordinate + * -1, zero, or 1 as this Coordinate is less than, equal to, or greater than the + * specified Coordinate */ override def compareTo(o: Coordinate): Int = { val other = o.asInstanceOf[Coordinate] diff --git a/modules/jts/src/main/scala/org/locationtech/jts/geom/LineSegment.scala b/modules/jts/src/main/scala/org/locationtech/jts/geom/LineSegment.scala index 6e9ed428..f7ab7891 100644 --- a/modules/jts/src/main/scala/org/locationtech/jts/geom/LineSegment.scala +++ b/modules/jts/src/main/scala/org/locationtech/jts/geom/LineSegment.scala @@ -128,8 +128,8 @@ class LineSegment(var p0: Coordinate, var p1: Coordinate) * * @param seg * the LineSegment to compare return 1 if seg is to the left of this segment return - * -1 if seg is to the right of this segment return 0 if seg is - * collinear to or crosses this segment + * -1 if seg is to the right of this segment return 0 if seg is + * collinear to or crosses this segment */ def orientationIndex(seg: LineSegment): Int = { val orient0 = Orientation.index(p0, p1, seg.p0) diff --git a/modules/jts/src/main/scala/org/locationtech/jts/geom/util/AffineTransformation.scala b/modules/jts/src/main/scala/org/locationtech/jts/geom/util/AffineTransformation.scala index bd5198f9..f6600f6c 100644 --- a/modules/jts/src/main/scala/org/locationtech/jts/geom/util/AffineTransformation.scala +++ b/modules/jts/src/main/scala/org/locationtech/jts/geom/util/AffineTransformation.scala @@ -414,8 +414,8 @@ class AffineTransformation() * of the inverse is equal to the inverse of the matrix for the transformation. It is computed as * follows:
 1 inverse(A) = --- x adjoint(A) det
    *
-   * \= 1 | m11 -m01 m01*m12-m02*m11 |
-   * --- x | -m10 m00 -m00*m12+m10*m02 | det | 0 0 m00*m11-m10*m01 |
+   * \= 1 | m11 -m01 m01*m12-m02*m11 | --- x | -m10 m00 -m00*m12+m10*m02 | det | 0 0 m00*m11-m10*m01
+   * \|
    *
    * \= | m11/det -m01/det m01*m12-m02*m11/det |
    * | -m10/det   m00/det  -m00*m12+m10*m02/det |
diff --git a/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/EdgeList.scala b/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/EdgeList.scala
index be01f047..e725a5a5 100644
--- a/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/EdgeList.scala
+++ b/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/EdgeList.scala
@@ -69,8 +69,7 @@ class EdgeList() {
   /**
    * If the edge e is already in the list, return its index.
    *
-   * return index, if e is already in the list
-   * -1 otherwise
+   * return index, if e is already in the list -1 otherwise
    */
   def findEdgeIndex(e: Edge): Int = {
     var i = 0
diff --git a/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/Quadrant.scala b/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/Quadrant.scala
index 0ab9874b..f97dfec7 100644
--- a/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/Quadrant.scala
+++ b/modules/jts/src/main/scala/org/locationtech/jts/geomgraph/Quadrant.scala
@@ -19,8 +19,8 @@ package org.locationtech.jts.geom
  */
 
 /**
- * Utility functions for working with quadrants, which are numbered as follows: 
 1 | 0
- * --+-- 2 | 3 
+ * Utility functions for working with quadrants, which are numbered as follows:
 1 | 0 --+-- 2
+ * \| 3 
* * @version 1.7 */ diff --git a/modules/jts/src/main/scala/org/locationtech/jts/index/strtree/AbstractSTRtree.scala b/modules/jts/src/main/scala/org/locationtech/jts/index/strtree/AbstractSTRtree.scala index f83b3337..9dc2973e 100644 --- a/modules/jts/src/main/scala/org/locationtech/jts/index/strtree/AbstractSTRtree.scala +++ b/modules/jts/src/main/scala/org/locationtech/jts/index/strtree/AbstractSTRtree.scala @@ -382,7 +382,7 @@ abstract class AbstractSTRtree(var nodeCapacity: Int) /** * @param level - * -1 to get items + * -1 to get items */ private def boundablesAtLevel( level: Int, diff --git a/modules/jts/src/main/scala/org/locationtech/jts/math/DD.scala b/modules/jts/src/main/scala/org/locationtech/jts/math/DD.scala index 40c5b989..215a1c66 100644 --- a/modules/jts/src/main/scala/org/locationtech/jts/math/DD.scala +++ b/modules/jts/src/main/scala/org/locationtech/jts/math/DD.scala @@ -37,11 +37,10 @@ import java.io.Serializable *

For example, the following code example constructs three DD instances: two to hold the input * values and one to hold the result of the addition.

 DD a = new DD(2.0); DD b = new DD(3.0);
  * DD c = a.add(b); 
In contrast, the following approach uses only one object:
 DD a =
- * new DD(2.0);
- * a.selfAdd(3.0); 

This implementation uses algorithms originally designed variously by - * Knuth, Kahan, Dekker, and Linnainmaa. Douglas Priest developed the first C implementation of - * these techniques. Other more recent C++ implementation are due to Keith M. Briggs and David - * Bailey et al. + * new DD(2.0); a.selfAdd(3.0);

This implementation uses algorithms originally designed + * variously by Knuth, Kahan, Dekker, and Linnainmaa. Douglas Priest developed the first C + * implementation of these techniques. Other more recent C++ implementation are due to Keith M. + * Briggs and David Bailey et al. * *

References