stringbean / sbt-dependency-lock

sbt plugin for creating dependency lockfiles
https://stringbean.github.io/sbt-dependency-lock
Apache License 2.0
14 stars 6 forks source link

Do not update the lockfile on write when there is only a timestamp change #29

Closed dasormeter closed 2 years ago

dasormeter commented 2 years ago

When there are no detected differences between the current lockfile and the changes to be commited (typically the only change would be a timestamp change) do not update the lockfile, to avoid diff'ing noise for an inconsequential timestamp change

dasormeter commented 2 years ago

Addresses #30

dasormeter commented 2 years ago

evidence of successful run of targets suggested in contribution guide

also ran scalafmt to ensure no formatting changes


❯ sbt "; test; scripted; headerCheck;"                                          sbt-dependency-lock-fork/git/do-not-update-lockfile-on-timestamp-only-change
[info] welcome to sbt 1.5.3 (Azul Systems, Inc. Java 11.0.10)
[info] loading global plugins from /Users/brianhealey/.sbt/1.0/plugins
[info] loading settings for project sbt-dependency-lock-fork-build from plugins.sbt ...
[info] loading project definition from /Users/brianhealey/g/sbt-dependency-lock-fork/project
[info] loading settings for project sbt-dependency-lock-fork from build.sbt,version.sbt ...
[info] set current project to sbt-dependency-lock (in build file:/Users/brianhealey/g/sbt-dependency-lock-fork/)
[info] compiling 12 Scala sources to /Users/brianhealey/g/sbt-dependency-lock-fork/target/scala-2.12/sbt-1.0/classes ...
[info] done compiling
[info] compiling 2 Scala sources to /Users/brianhealey/g/sbt-dependency-lock-fork/target/scala-2.12/sbt-1.0/test-classes ...
[info] done compiling
[info] DependencyLockFileSpec:
[info] findChanges
[info] - should return LockFileMatches for identical lockfiles
[info] - should return LockFileMatches if timestamp differs
[info] - should error if lock version differs
[info] - should return LockFileDiffers if configuration added
[info] - should return LockFileDiffers if configuration removed
[info] - should return LockFileDiffers if dependency added
[info] - should return LockFileDiffers if dependency removed
[info] - should return LockFileDiffers if dependency changed
[info] LockFileStatusSpec:
[info] LockFileMatches.toShortReport
[info] - should output correct message
[info] LockFileMatches.toLongReport
[info] - should output correct message
[info] LockFileDiffers.toShortReport
[info] - should render 1 config added
[info] - should render 2 configs added
[info] - should render 1 config removed
[info] - should render 1 config added and 2 configs removed
[info] - should render 1 dependency added
[info] - should render 2 dependencies removed
[info] - should render 1 dependency changed
[info] - should render 2 dependency artifacts changed
[info] - should render configs and dependencies changed
[info] LockFileDiffers.toLongReport
[info] - should render 1 config added
[info] - should render 1 config removed
[info] - should render 1 config added and 2 configs removed
[info] - should render 1 dependency added
[info] - should render 2 dependencies removed
[info] - should render 1 dependency changed version
[info] - should render 1 dependency changed configs
[info] - should render 1 dependency changed version and configs
[info] - should render 2 dependency artifacts changed
[info] - should sort dependencies
[info] - should render lots of changes
[info] Run completed in 333 milliseconds.
[info] Total number of tests run: 30
[info] Suites: completed 2, aborted 0
[info] Tests: succeeded 30, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 9 s, completed Jan 24, 2022, 6:48:09 PM
[info] Main Scala API documentation to /Users/brianhealey/g/sbt-dependency-lock-fork/target/scala-2.12/sbt-1.0/api...
[info] Wrote /Users/brianhealey/g/sbt-dependency-lock-fork/target/scala-2.12/sbt-1.0/sbt-dependency-lock-1.2.1-SNAPSHOT.pom
model contains 22 documentable templates
[info] Main Scala API documentation successful.
[info] :: delivering :: software.purpledragon#sbt-dependency-lock;1.2.1-SNAPSHOT :: 1.2.1-SNAPSHOT :: integration :: Mon Jan 24 18:48:12 EST 2022
[info]  delivering ivy file to /Users/brianhealey/g/sbt-dependency-lock-fork/target/scala-2.12/sbt-1.0/ivy-1.2.1-SNAPSHOT.xml
[info]  published sbt-dependency-lock to /Users/brianhealey/.ivy2/local/software.purpledragon/sbt-dependency-lock/scala_2.12/sbt_1.0/1.2.1-SNAPSHOT/poms/sbt-dependency-lock.pom
[info]  published sbt-dependency-lock to /Users/brianhealey/.ivy2/local/software.purpledragon/sbt-dependency-lock/scala_2.12/sbt_1.0/1.2.1-SNAPSHOT/jars/sbt-dependency-lock.jar
[info]  published sbt-dependency-lock to /Users/brianhealey/.ivy2/local/software.purpledragon/sbt-dependency-lock/scala_2.12/sbt_1.0/1.2.1-SNAPSHOT/srcs/sbt-dependency-lock-sources.jar
[info]  published sbt-dependency-lock to /Users/brianhealey/.ivy2/local/software.purpledragon/sbt-dependency-lock/scala_2.12/sbt_1.0/1.2.1-SNAPSHOT/docs/sbt-dependency-lock-javadoc.jar
[info]  published ivy to /Users/brianhealey/.ivy2/local/software.purpledragon/sbt-dependency-lock/scala_2.12/sbt_1.0/1.2.1-SNAPSHOT/ivys/ivy.xml
Running update / fail-differences
Running update / disabled-same
Running update / warn-differences
Running update / warn-same
Running update / fail-same
Running update / disabled-differences
Running dependencyLockCheck / pass-different-order
Running dependencyLockCheck / pass
Running dependencyLockCheck / fail-differences
Running dependencyLockCheck / fail-missing-file
[success] Total time: 131 s (02:11), completed Jan 24, 2022, 6:50:20 PM
[success] Total time: 0 s, completed Jan 24, 2022, 6:50:20 PM```
stringbean commented 2 years ago

Sorry for the delay looking at this. I'll get this merged in and a release shipped shortly.

stringbean commented 2 years ago

Released in 1.3.0.

dasormeter commented 2 years ago

Released in 1.3.0.

Great -- thank you