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

Drop 2.12 support, prepare for 1.1.0 changes #5

Merged
merged 1 commit into from
Aug 30, 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
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
test:
Expand All @@ -11,7 +11,6 @@ jobs:
matrix:
scala:
- 2.13.14
- 2.12.19
- 3.3.3

steps:
Expand All @@ -25,7 +24,7 @@ jobs:
java-version: openjdk@1.11

- name: build ${{ matrix.scala }}
run: sbt ++${{ matrix.scala }} clean coverage test
run: sbt ++${{ matrix.scala }} clean check coverage test

- name: test coverage
if: success()
Expand Down
9 changes: 6 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
version = 2.2.1
version = "3.8.3"

runner.dialect = scala213source3

align = most
continuationIndent.callSite = 2
continuationIndent.defnSite = 2
danglingParentheses = true
indentOperator = spray
maxColumn = 150
newlines.alwaysBeforeTopLevelStatements = true
align.preset = "most"
danglingParentheses.preset = true
project.excludeFilters = [".*\\.sbt"]
rewrite.rules = [RedundantParens, SortImports]
spaces.inImportCurlyBraces = false
unindentTopLevelOperators = true
indentOperator.exemptScope = all
28 changes: 21 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,35 @@ name := "prometheus-tools"

organization := "com.evolutiongaming"

homepage := Some(new URL("http://github.com/evolution-gaming/prometheus-tools"))
homepage := Some(url("https://github.com/evolution-gaming/prometheus-tools"))

startYear := Some(2018)

organizationName := "Evolution"

organizationHomepage := Some(url("http://evolution.com"))
organizationHomepage := Some(url("https://evolution.com"))

crossScalaVersions := Seq("2.13.14", "2.12.19", "3.3.3")
crossScalaVersions := Seq("2.13.14", "3.3.3")

scalaVersion := crossScalaVersions.value.head

Compile / scalacOptions ++= Seq("-language:implicitConversions")
Compile / scalacOptions ++= {
if (scalaBinaryVersion.value == "2.13") {
Seq(
"-Xsource:3"
)
} else Seq.empty
Comment on lines +19 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe?

Suggested change
if (scalaBinaryVersion.value == "2.13") {
Seq(
"-Xsource:3"
)
} else Seq.empty
if (scalaBinaryVersion.value == "2.13") Seq("-Xsource:3")
else Seq.empty

}

Compile / doc / scalacOptions ++= Seq("-groups", "-implicits", "-no-link-warnings")

publishTo := Some(Resolver.evolutionReleases)

libraryDependencies ++= Seq(
"com.evolutiongaming" %% "executor-tools" % "1.0.4",
"io.prometheus" % "simpleclient_common" % "0.8.1",
"org.scalameta" %% "munit" % "0.7.29" % Test
"com.evolutiongaming" %% "executor-tools" % "1.0.4",
"io.prometheus" % "simpleclient_common" % "0.8.1",
"org.scalameta" %% "munit" % "1.0.0" % Test
)

testFrameworks += new TestFramework("munit.Framework")
Expand All @@ -34,4 +41,11 @@ releaseCrossBuild := true

ThisBuild / versionScheme := Some("semver-spec")

addCommandAlias("check", "all scalafmtCheckAll scalafmtSbtCheck")
// Your next release will be binary compatible with the previous one,
// but it may not be source compatible (ie, it will be a minor release).
ThisBuild / versionPolicyIntention := Compatibility.BinaryCompatible

//used by evolution-gaming/scala-github-actions
addCommandAlias("check", "all versionPolicyCheck Compile/doc scalafmtCheckAll scalafmtSbtCheck")

addCommandAlias("fmtAll", "all scalafmtAll scalafmtSbt")
18 changes: 7 additions & 11 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")

addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11")

addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")

addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9")
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("com.evolution" % "sbt-scalac-opts-plugin" % "0.0.9")
addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.2.1")
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ object ObserveDuration {
hasObserve.observe(observer, value)
}

override def timeTillNowNanos[T](start: T)(
implicit numeric: Numeric[T]
override def timeTillNowNanos[T](start: T)(implicit
numeric: Numeric[T]
): Unit = {
Comment on lines +54 to 56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we?:

Suggested change
override def timeTillNowNanos[T](start: T)(implicit
numeric: Numeric[T]
): Unit = {
override def timeTillNowNanos[T](start: T)(implicit numeric: Numeric[T]): Unit = {

val value = duration(start, clock.nowNano) / Collector.NANOSECONDS_PER_SECOND
hasObserve.observe(observer, value)
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ThisBuild / version := "1.0.9-SNAPSHOT"
ThisBuild / version := "1.1.0-SNAPSHOT"
Loading