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

document how to use SNAPSHOT versions #3154

Closed
bblfish opened this issue Mar 9, 2022 · 8 comments · Fixed by #3155
Closed

document how to use SNAPSHOT versions #3154

bblfish opened this issue Mar 9, 2022 · 8 comments · Fixed by #3155

Comments

@bblfish
Copy link

bblfish commented Mar 9, 2022

version = "3.4.3+23-1483abef-SNAPSHOT"

When I try to use the latest SNAPSHOT because I want to use a new feature to test it,
I get the error

[error] (Test / scalafmtCheck) org.scalafmt.sbt.ScalafmtSbtReporter$ScalafmtSbtError: scalafmt: Invalid config: version [expected 3.4.3]: 3.4.3+23-1483abef-SNAPSHOT [/home/runner/work/Reactive-SoLiD/Reactive-SoLiD/.scalafmt.conf]

See the PR co-operating-systems/Reactive-SoLiD#21
and the errors generated by Continuous Integration.

I could not find any documentation on how to do this correctly.

@kitbellew
Copy link
Collaborator

kitbellew commented Mar 9, 2022

@bblfish our recently updated issue template, which you're not following here, should have asked you to verify this problem with scalafmt CLI. it looks like you used the sbt integration instead, which might mean the problem is elsewhere.

@bblfish
Copy link
Author

bblfish commented Mar 9, 2022

If I update .scalafmt.conf with version = "3.4.3+14-e16384f2-SNAPSHOT"
Then run the following to get it to work

╭─cosy@bblfish.local /Volumes/Dev/Programming/Scala3/Solid/Reactive  ‹work*›
╰─➤  rm scalafmt
╭─cosy@bblfish.local /Volumes/Dev/Programming/Scala3/Solid/Reactive  ‹work*›
╰─➤  coursier bootstrap "org.scalameta:scalafmt-cli_2.13:3.4.3+14-e16384f2-SNAPSHOT" \
  -r sonatype:snapshots --main org.scalafmt.cli.Cli \
  --standalone \
  -o scalafmt
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-cli_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-cli_2.13-3.4.3+14-e1638…
  100.0% [##########] 3.5 KiB (6.5 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-dynamic_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-dynamic_2.13-3.4.3+…
  100.0% [##########] 2.8 KiB (22.2 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-core_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-core_2.13-3.4.3+14-e16…
  100.0% [##########] 3.2 KiB (8.8 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-sysops_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-sysops_2.13-3.4.3+14…
  100.0% [##########] 2.4 KiB (18.6 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-config_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-config_2.13-3.4.3+14…
  100.0% [##########] 2.6 KiB (18.4 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-interfaces/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-interfaces-3.4.3+14-e…
  100.0% [##########] 2.1 KiB (5.7 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-config_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-config_2.13-3.4.3+14…
  100.0% [##########] 9.2 KiB (24.4 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-interfaces/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-interfaces-3.4.3+14-e…
  100.0% [##########] 5.3 KiB (14.0 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-sysops_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-sysops_2.13-3.4.3+14…
  100.0% [##########] 44.5 KiB (117.2 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-dynamic_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-dynamic_2.13-3.4.3+…
  100.0% [##########] 138.8 KiB (281.1 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-cli_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-cli_2.13-3.4.3+14-e1638…
  100.0% [##########] 160.6 KiB (218.6 KiB / s)
https://oss.sonatype.org/content/repositories/snapshots/org/scalameta/scalafmt-core_2.13/3.4.3+14-e16384f2-SNAPSHOT/scalafmt-core_2.13-3.4.3+14-e16…
  100.0% [##########] 1.9 MiB (1.9 MiB / s)
Wrote /Volumes/Dev/Programming/Scala3/Solid/Reactive/scalafmt
╭─cosy@bblfish.local /Volumes/Dev/Programming/Scala3/Solid/Reactive  ‹work*›
╰─➤  scalafmt
Invalid config: version [expected 3.4.3]: 3.4.3+14-e16384f2-SNAPSHOT: /Volumes/Dev/Programming/Scala3/Solid/Reactive/.scalafmt.conf

I get the same error with

╭─cosy@bblfish.local /Volumes/Dev/Programming/Scala3/Solid/Reactive  ‹work*›
╰─➤ coursier bootstrap "org.scalameta:scalafmt-cli_2.13:3.4.3+23-1483abef-SNAPSHOT" \
  -f -r sonatype:snapshots --main org.scalafmt.cli.Cli \
  --standalone \
  -o scalafmt
╭─cosy@bblfish.local /Volumes/Dev/Programming/Scala3/Solid/Reactive  ‹work*›
╰─➤  ./scalafmt
Invalid config: version [expected 3.4.3]: 3.4.3+14-e16384f2-SNAPSHOT: /Volumes/Dev/Programming/Scala3/Solid/Reactive/.scalafmt.conf

@bblfish
Copy link
Author

bblfish commented Mar 9, 2022

If I then set the version in .scalafmt.conf to version = "3.4.3"
then I get...
Then it works...

bblfish added a commit to co-operating-systems/Reactive-SoLiD that referenced this issue Mar 9, 2022
@bblfish
Copy link
Author

bblfish commented Mar 9, 2022

The commit above succeeded in using the matchSite features from #3126 with the command line interface

But I can't get it to work within sbt, so that my continuous integration tests don't pass.
Where should I report that?

@kitbellew
Copy link
Collaborator

if it works in CLI but not sbt plugin, then, obviously, in sbt plugin.

@kitbellew
Copy link
Collaborator

can you please try downloading (using coursier) a different version (take any published version from the last year), while specifying the desired snapshot version in the config file? does that work?

@bblfish
Copy link
Author

bblfish commented Mar 10, 2022

can you please try downloading (using coursier) a different version (take any published version from the last year)

I tried two versions in my report above #3154 (comment)
was that not enough? (Or do you mean something else?)

@bblfish
Copy link
Author

bblfish commented Mar 11, 2022

This change also fixed the sbt-plugin problem. See PR for httpSig
bblfish/httpSig#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants