Skip to content

Commit

Permalink
Run prePR with sbt-typelevel
Browse files Browse the repository at this point in the history
Executed command: sbt tlPrePrBotHook
  • Loading branch information
lucuma-steward[bot] committed Jul 16, 2024
1 parent cf751b7 commit dcc01a9
Show file tree
Hide file tree
Showing 75 changed files with 241 additions and 251 deletions.
116 changes: 54 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,86 +15,80 @@ 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: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v3
uses: actions/checkout@v4
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
uses: actions/setup-java@v4
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 +update

- run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'show coverageEnabled'

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck

- name: Check headers and formatting
if: matrix.java == 'temurin@17'
if: matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest'
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

- 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

- name: Upload code coverage data
run: 'bash <(curl -s https://codecov.io/bash)'
uses: codecov/codecov-action@v4

publish:
name: Publish Artifacts
Expand All @@ -103,53 +97,51 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.2.2]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
if: contains(runner.os, 'macos')
run: brew install sbt

- name: Checkout current branch (full)
uses: actions/checkout@v3
uses: actions/checkout@v4
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
uses: actions/setup-java@v4
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 +update

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
run: echo $PGP_SECRET | base64 -di | gpg --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: echo $PGP_SECRET | base64 -d -i - | 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_SECRET" | base64 -d -i - > /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
8 changes: 4 additions & 4 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .scalafix-common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
rules = [
OrganizeImports
]
OrganizeImports.targetDialect = Auto
5 changes: 3 additions & 2 deletions .scalafmt-common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
# 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.8.0"
style = default

runner.dialect = scala213source3
runner.dialect = scala3
runner.optimizer.maxVisitsPerToken = 20000 # Avoids SearchStateExploded exceptions

maxColumn = 100
project.git = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ object CGAlgorithms {
* point to check for ring inclusion
* @param ring
* an array of coordinates representing the ring (which must have first point identical to last
* point) return the { @link Location} of p relative to the ring
* point) return the {@link Location} of p relative to the ring
*/
def locatePointInRing(p: Coordinate, ring: Array[Coordinate]): Int =
RayCrossingCounter.locatePointInRing(p, ring)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -200,7 +200,7 @@ class Centroid(val geom: Geometry) {
* Adds the line segments defined by an array of coordinates to the linear centroid accumulators.
*
* @param pts
* an array of { @link Coordinate}s
* an array of {@link Coordinate} s
*/
private def addLineSegments(pts: Array[Coordinate]): Unit = {
var lineLen = 0.0
Expand All @@ -225,7 +225,7 @@ class Centroid(val geom: Geometry) {
* Adds a point to the point centroid accumulator.
*
* @param pt
* a { @link Coordinate}
* a {@link Coordinate}
*/
private def addPoint(pt: Coordinate): Unit = {
ptCount += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ class ConvexHull(val pts: Array[Coordinate], var geomFactory: GeometryFactory) {
* geometry contains the minimal number of points needed to represent the convex hull. In
* particular, no more than two consecutive points will be collinear.
*
* return if the convex hull contains 3 or more points, a { @link Polygon}; 2 points, a { @link
* LineString}; 1 point, a { @link Point}; 0 points, an empty { @link GeometryCollection}.
* return if the convex hull contains 3 or more points, a {@link Polygon} ; 2 points, a { @link
* LineString}; 1 point, a {@link Point} ; 0 points, an empty {@link GeometryCollection} .
*/
def getConvexHull: Geometry = {
if (inputPts.length == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object HCoordinate {
* to this routine.
*
* @deprecated
* use { @link Intersection#intersection(Coordinate, Coordinate, Coordinate, Coordinate)}
* use {@link Intersection#intersection(Coordinate, Coordinate, Coordinate, Coordinate)}
*/
@throws[NotRepresentableException]
def intersection(p1: Coordinate, p2: Coordinate, q1: Coordinate, q2: Coordinate): Coordinate = { // unrolled computation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class MinimumDiameter(val inputGeom: Geometry, val isConvex: Boolean) {
/**
* Gets a {link LineString} which is a minimum diameter
*
* return a { @link LineString} which is a minimum diameter
* return a {@link LineString} which is a minimum diameter
*/
def getDiameter: LineString = {
computeMinimumDiameter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ object Orientation {
* @param p2
* the final point of the line vector
* @param q
* the point to compute the direction to return -1 ( { @link #CLOCKWISE} or { @link #RIGHT} ) if
* q is clockwise (right) from p1-p2; 1 ( { @link #COUNTERCLOCKWISE} or { @link #LEFT} ) if q is
* counter-clockwise (left) from p1-p2; 0 ( { @link #COLLINEAR} or { @link #STRAIGHT} ) if q is
* the point to compute the direction to return -1 ( {@link #CLOCKWISE} or {@link #RIGHT} ) if q
* is clockwise (right) from p1-p2; 1 ( {@link #COUNTERCLOCKWISE} or {@link #LEFT} ) if q is
* counter-clockwise (left) from p1-p2; 0 ( {@link #COLLINEAR} or {@link #STRAIGHT} ) if q is
* collinear with p1-p2
*/
def index(p1: Coordinate, p2: Coordinate, q: Coordinate): Int =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ object PointLocation {
* point to check for ring inclusion
* @param ring
* an array of coordinates representing the ring (which must have first point identical to last
* point) return the { @link Location} of p relative to the ring
* point) return the {@link Location} of p relative to the ring
*/
def locateInRing(p: Coordinate, ring: Array[Coordinate]): Int =
RayCrossingCounter.locatePointInRing(p, ring)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PointLocator(boundaryRule: BoundaryNodeRule = BoundaryNodeRule.OGC_SFS_BOU
* handles both single-element and multi-element Geometries. The algorithm for multi-part
* Geometries takes into account the SFS Boundary Determination Rule.
*
* return the { @link Location} of the point relative to the input Geometry
* return the {@link Location} of the point relative to the input Geometry
*/
def locate(p: Coordinate, geom: Geometry): Int = {
if (geom.isEmpty) return Location.EXTERIOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ object Coordinate {
* Compares two {link Coordinate}s along to the number of dimensions specified.
*
* @param o1
* a { @link Coordinate}
* a {@link Coordinate}
* @param o2
* a {link Coordinate} return -1, 0, or 1 depending on whether o1 is less than, equal to, or
* greater than 02
Expand Down Expand Up @@ -375,8 +375,8 @@ class Coordinate(var x: Double, var y: Double, var z: Double)
*
* @param o
* the <code>Coordinate</code> with which this <code>Coordinate</code> is being compared return
* -1, zero, or 1 as this <code>Coordinate</code> is less than, equal to, or greater than the
* specified <code>Coordinate</code>
* -1, zero, or 1 as this <code>Coordinate</code> is less than, equal to, or greater than the
* specified <code>Coordinate</code>
*/
override def compareTo(o: Coordinate): Int = {
val other = o.asInstanceOf[Coordinate]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ object CoordinateArrays {
* Finds a point in a list of points which is not contained in another list of points
*
* @param testPts
* the { @link Coordinate}s to test
* the {@link Coordinate} s to test
* @param pts
* an array of { @link Coordinate}s to test the input points against return a { @link
* an array of {@link Coordinate} s to test the input points against return a { @link
* Coordinate} from <code>testPts</code> which is not in <code>pts</code>, ' or
* <code>null</code>
*/
Expand Down Expand Up @@ -514,8 +514,8 @@ object CoordinateArrays {

/**
* Shifts the positions of the coordinates until the coordinate at
* <code>indexOfFirstCoordinate</code> is first. <p/> If {@code ensureRing} is {@code true}, first
* and last coordinate of the returned array are equal.
* <code>indexOfFirstCoordinate</code> is first. <p/> If {@code ensureRing} is {@code true} ,
* first and last coordinate of the returned array are equal.
*
* @param coordinates
* the array to rearrange
Expand Down
Loading

0 comments on commit dcc01a9

Please sign in to comment.