Skip to content

Commit

Permalink
Merge pull request #20 from schlawg/master
Browse files Browse the repository at this point in the history
compression in scala
  • Loading branch information
ornicar authored Jan 20, 2025
2 parents e675db1 + c6bb04f commit 217b1c3
Show file tree
Hide file tree
Showing 43 changed files with 70,647 additions and 22,843 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ name: Test
on: [push, pull_request]

jobs:
openjdk17:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
java-version: 21
cache: sbt
- name: Setup sbt
uses: sbt/setup-sbt@v1
- run: sbt test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.bsp/
target/
project/metals.sbt
project/project/
8 changes: 6 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
version = "3.7.10"
version = "3.8.4"
runner.dialect = scala3

align.preset = more
maxColumn = 110
spaces.inImportCurlyBraces = true
rewrite.rules = [SortImports, RedundantParens, SortModifiers]
rewrite.rules = [SortModifiers]
rewrite.redundantBraces.stringInterpolation = true

rewrite.scala3.convertToNewSyntax = yes
rewrite.scala3.removeOptionalBraces = yes
rewrite.rules = [AvoidInfix]
docstrings.style = keep // don't format comment
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
Chess clock and move compression algorithms for lichess.org
===========================================================
# Chess clock and move compression algorithms for lichess.org

Blog posts
----------
## Disclaimer

* [A better game clock history](https://lichess.org/blog/WOEVrjAAALNI-fWS/a-better-game-clock-history)
* [Developer update: 275% improved game compression](https://lichess.org/blog/Wqa7GiAAAOIpBLoY/developer-update-275-improved-game-compression)
This library was migrated from the Java language to the Scala language.
Only the language syntax changed to Scala; the design and paradigms of the Java program were kept.
This is not how Scala code should be written, it is not idiomatic.

License
-------
## Blog posts

- [A better game clock history](https://lichess.org/blog/WOEVrjAAALNI-fWS/a-better-game-clock-history)
- [Developer update: 275% improved game compression](https://lichess.org/blog/Wqa7GiAAAOIpBLoY/developer-update-275-improved-game-compression)

## License

This library is licensed under the GNU Affero General Public License 3 or
any later version at your option. See LICENSE for the full license text.
9 changes: 4 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lazy val compression = Project("compression", file("."))
scalaVersion := "3.3.0"
scalaVersion := "3.6.2"
name := "compression"
organization := "org.lichess"
version := "1.10"
resolvers += "lila-maven" at "https://raw.githubusercontent.com/ornicar/lila-maven/master"
version := "2.0"
resolvers += "lila-maven".at("https://raw.githubusercontent.com/ornicar/lila-maven/master")
libraryDependencies += "org.specs2" %% "specs2-core" % "4.17.0" % Test
scalacOptions := Seq(
"-encoding",
Expand All @@ -14,7 +14,6 @@ scalacOptions := Seq(
"-indent",
"-rewrite",
"-source:future-migration",
"-release:17",
"-release:21"
)
javacOptions ++= Seq("--release", "17")
publishTo := Some(Resolver.file("file", new File(sys.props.getOrElse("publishTo", ""))))
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.2
sbt.version=1.10.7
11 changes: 0 additions & 11 deletions src/main/java/BitOps.java

This file was deleted.

40 changes: 0 additions & 40 deletions src/main/java/BitReader.java

This file was deleted.

37 changes: 0 additions & 37 deletions src/main/java/BitWriter.java

This file was deleted.

38 changes: 0 additions & 38 deletions src/main/java/IntArrayList.java

This file was deleted.

60 changes: 0 additions & 60 deletions src/main/java/VarIntEncoder.java

This file was deleted.

48 changes: 0 additions & 48 deletions src/main/java/clock/Encoder.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/java/clock/EndTimeEstimator.java

This file was deleted.

41 changes: 0 additions & 41 deletions src/main/java/clock/LinearEstimator.java

This file was deleted.

Loading

0 comments on commit 217b1c3

Please sign in to comment.