You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Fixed commas being treated as `using` directive value separators & deprecated using them with whitespace
14
+
:::warning
15
+
These are breaking changes affecting using directives syntax.
16
+
They're technically fixes + a deprecation, but in a very rare scenario existing builds could break, if they were relying on the erroneous syntax.
17
+
:::
18
+
19
+
This Scala CLI version fixes commas (`,`) being treated as `using` directive value separators on their own.
20
+
21
+
Formerly, a directive like:
22
+
23
+
```scala compile
24
+
//> using options -Wunused:locals,privates
25
+
```
26
+
27
+
Would be (erroneously) interpreted as the following 2 options for the compiler: `-Wunused:locals` and `privates`.
28
+
As a comma will now no longer be treated as a separator (which it never should have been), it will now be interpreted correctly as
29
+
a single option: `-Wunused:locals,privates`.
30
+
Before this change, the only way to pass this value to the `options` directive key was escaping the comma with double quotes:
31
+
```scala compile
32
+
//> using options "-Wunused:locals,privates"
33
+
```
34
+
The escaping is no longer necessary.
35
+
36
+
Additionally, using commas along with whitespace as separators is now deprecated for future removal.
37
+
```bash ignore
38
+
scala-cli compile --scala-snippet '//> using options -Wunused:locals, -Wunused:privates'
39
+
# [warn] <snippet>-scala-snippet:1:34
40
+
# [warn] Use of commas as separators is deprecated. Only whitespace is neccessary.
41
+
# Starting compilation server
42
+
# Compiling project (Scala 3.6.3, JVM (23))
43
+
# Compiled project (Scala 3.6.3, JVM (23))
44
+
```
45
+
46
+
Finally, the use of `/* (..) */` comments in `using` directives is no longer supported.
47
+
```scala fail
48
+
//> using /* some comment */ options -Wunused:locals /* some other comment */ -Wunused:privates
49
+
// this syntax used to be supported, but will now fail.
50
+
```
51
+
52
+
Added by [@Gedochao](https://github.com/Gedochao) in [#3381](https://github.com/VirtusLab/scala-cli/pull/3381) and [#3333](https://github.com/VirtusLab/scala-cli/pull/3333)
53
+
54
+
### Cap vague Scala versions at defaults
55
+
:::warning
56
+
This is a breaking change regarding how the Scala version is resolved.
57
+
:::
58
+
We have changed how a Scala version is picked when `major` or `major.minor` prefixes are passed, rather than the full version tag:
59
+
- `-S 3` will now point to the [launcher default Scala 3 Next version](https://github.com/VirtusLab/scala-cli/blob/72c23a54ac3ef0d3b09aa2646733225a1ac8426a/project/deps.sc#L11), rather than whatever is the latest stable version that `coursier` can find upstream
60
+
- similarly, `-S 3.<current launcher default minor>` will now point to the [launcher default Scala 3 Next version](https://github.com/VirtusLab/scala-cli/blob/72c23a54ac3ef0d3b09aa2646733225a1ac8426a/project/deps.sc#L11)
61
+
- `-S 2.13` will point to the[ launcher default Scala 2.13 version](https://github.com/VirtusLab/scala-cli/blob/72c23a54ac3ef0d3b09aa2646733225a1ac8426a/project/deps.sc#L7) (which up till now only affected tests and generated docs)
62
+
- similarly, `-S 2.12` will now point to the [launcher default Scala 2.12 version](https://github.com/VirtusLab/scala-cli/blob/72c23a54ac3ef0d3b09aa2646733225a1ac8426a/project/deps.sc#L6)
63
+
- launcher defaults are overridden for a particular Scala series with the `--cli-user-scala-version` to accommodate for Scala CLI installed as `scala`
64
+
65
+
For example:
66
+
```scala
67
+
//> using 3
68
+
// When compiled with Scala CLI v1.6.0, this snippet will use Scala 3.6.3 (the built-in default), even if a newer version has been released.
69
+
```
70
+
71
+
Added by [@Gedochao](https://github.com/Gedochao) in [#3259](https://github.com/VirtusLab/scala-cli/pull/3259)
72
+
73
+
### Support for Scala 3.6.3 and 2.13.16
74
+
This Scala CLI version switches the default Scala version to 3.6.3.
75
+
76
+
```bash
77
+
scala-cli version
78
+
# Scala CLI version: 1.6.0
79
+
# Scala version (default): 3.6.3
80
+
```
81
+
82
+
It has also been tested with Scala 2.13.16.
83
+
84
+
Added by [@Gedochao](https://github.com/Gedochao) in [#3426](https://github.com/VirtusLab/scala-cli/pull/3426) and [#3418](https://github.com/VirtusLab/scala-cli/pull/3418)
85
+
86
+
### Support for Scala.js 1.18.1
87
+
This Scala CLI version adds support for Scala.js 1.18.1.
Added in [#3440](https://github.com/VirtusLab/scala-cli/pull/3440) and [scala-js-cli#113](https://github.com/VirtusLab/scala-js-cli/pull/113)
97
+
98
+
### (⚡️ experimental) `scalafix` integration
99
+
We now support running `scalafix` rules with the `fix` sub-command.
100
+
```bash ignore
101
+
scala-cli fix . --power
102
+
# The `fix` sub-command is experimental
103
+
# Please bear in mind that non-ideal user experience should be expected.
104
+
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
105
+
# Running built-in rules...
106
+
# Writing project.scala
107
+
# Removing directives from Smth.scala
108
+
# Built-in rules completed.
109
+
# Running scalafix rules...
110
+
# Starting compilation server
111
+
# Compiling project (Scala 3.6.3, JVM (23))
112
+
# [warn] ./Main.scala:2:7
113
+
# [warn] unused local definition
114
+
# [warn] val unused = "unused"
115
+
# [warn] ^^^^^^
116
+
# Compiled project (Scala 3.6.3, JVM (23))
117
+
# scalafix rules completed.
118
+
```
119
+
120
+
Former fix functionalities are now referred to in the code as the built-in rules.
121
+
Effectively, fix now runs 2 separate sets of rules (both enabled by default): built-in and scalafix.
122
+
They can be controlled via the `--enable-scalafix` and `--enable-built-in` command line options.
123
+
124
+
`scalafix` rules are ran according to the configuration in `<project-root>/.scalafix.conf`.
125
+
126
+
It is possible to run [external scalafix rules](https://scalacenter.github.io/scalafix/docs/rules/external-rules.html) with the (⚡️ experimental) `scalafix.dep` directive:
127
+
```scala compile power
128
+
//> using scalafix.dep com.github.xuwei-k::scalafix-rules:0.6.0
129
+
```
130
+
131
+
Added by [@Vigorge](https://github.com/Vigorge) and [@dos65](https://github.com/dos65) in [#2968](https://github.com/VirtusLab/scala-cli/pull/2968)
132
+
133
+
### Support for running snapshot versions of the build server (Bloop)
134
+
It is now possible to pass a snapshot version to the `--bloop-version` command line option.
Added by [@Gedochao](https://github.com/Gedochao) in [#3406](https://github.com/VirtusLab/scala-cli/pull/3406)
165
+
166
+
### Features
167
+
* Scalafix command for scala-cli with basic options and tests by [@Vigorge](https://github.com/Vigorge) and [@dos65](https://github.com/dos65) in [#2968](https://github.com/VirtusLab/scala-cli/pull/2968)
168
+
* Ensure vague Scala versions are capped at defaults by [@Gedochao](https://github.com/Gedochao) in [#3259](https://github.com/VirtusLab/scala-cli/pull/3259)
169
+
* Merge `scalafix` into `fix` by [@Gedochao](https://github.com/Gedochao) in [#3400](https://github.com/VirtusLab/scala-cli/pull/3400)
170
+
* Allow to use Bloop snapshot versions by [@Gedochao](https://github.com/Gedochao) in [#3405](https://github.com/VirtusLab/scala-cli/pull/3405)
171
+
* Add ways to suppress deprecation warnings by [@Gedochao](https://github.com/Gedochao) in [#3406](https://github.com/VirtusLab/scala-cli/pull/3406)
172
+
173
+
### Fixes
174
+
* Misc improvements in compiler options handling by [@Gedochao](https://github.com/Gedochao) in [#3253](https://github.com/VirtusLab/scala-cli/pull/3253)
175
+
* Allow shading of single-choice compiler options from the command line regardless of `-`/`--` prefix by [@Gedochao](https://github.com/Gedochao) in [#3279](https://github.com/VirtusLab/scala-cli/pull/3279)
176
+
* Fix dependency main class detection throwing an NPE when JAR manifest doesn't list the main class correctly by [@Gedochao](https://github.com/Gedochao) in [#3319](https://github.com/VirtusLab/scala-cli/pull/3319)
177
+
* Fix commas being treated as `using` directives value separators & deprecate using them with whitespace by [@Gedochao](https://github.com/Gedochao) in [#3333](https://github.com/VirtusLab/scala-cli/pull/3333)
178
+
* Retain Bloop connection when restarting a build with `--watch` by [@Gedochao](https://github.com/Gedochao) in [#3351](https://github.com/VirtusLab/scala-cli/pull/3351)
179
+
* Improve deprecation warnings for commas with whitespace used as using directive value separators by [@Gedochao](https://github.com/Gedochao) in [#3366](https://github.com/VirtusLab/scala-cli/pull/3366)
180
+
* Recover from invalid paths returned from Bloop diagnostics by [@Gedochao](https://github.com/Gedochao) in [#3372](https://github.com/VirtusLab/scala-cli/pull/3372)
181
+
* Add missing support for excluding transient dependencies when publishing by [@Gedochao](https://github.com/Gedochao) in [#3357](https://github.com/VirtusLab/scala-cli/pull/3357)
182
+
* Fix using directives crashing on `*/` by removing `/* (..) */` comments support in `using_directives` by [@Gedochao](https://github.com/Gedochao) in [#3381](https://github.com/VirtusLab/scala-cli/pull/3381)
183
+
* `fix` built-in rules: don't wrap directive values in double quotes if not necessary by [@Gedochao](https://github.com/Gedochao) in [#3414](https://github.com/VirtusLab/scala-cli/pull/3414)
184
+
* Don't migrate directives with `fix` for single-file projects by [@Gedochao](https://github.com/Gedochao) in [#3422](https://github.com/VirtusLab/scala-cli/pull/3422)
185
+
* Temporarily disable built-in rules of `fix` when `--check` is enabled, until fully supported by [@Gedochao](https://github.com/Gedochao) in [#3427](https://github.com/VirtusLab/scala-cli/pull/3427)
186
+
* Ensure test source directives with test scope equivalents are migrated by `fix` to `project.scala` by [@Gedochao](https://github.com/Gedochao) in [#3425](https://github.com/VirtusLab/scala-cli/pull/3425)
187
+
188
+
### Internal and build changes
189
+
* Retry some of the occasionally flaky tests when failing on the CI by [@Gedochao](https://github.com/Gedochao) in [#3320](https://github.com/VirtusLab/scala-cli/pull/3320)
190
+
* Retry more occasionally flaky tests on the CI by [@Gedochao](https://github.com/Gedochao) in [#3331](https://github.com/VirtusLab/scala-cli/pull/3331)
191
+
* Tag `scalajs-dom` tests as flaky by [@Gedochao](https://github.com/Gedochao) in [#3336](https://github.com/VirtusLab/scala-cli/pull/3336)
192
+
* Tag native packager tests as flaky by [@Gedochao](https://github.com/Gedochao) in [#3344](https://github.com/VirtusLab/scala-cli/pull/3344)
193
+
* Make `generate-junit-reports.sc` script recover from test failures containing no trace data by [@Gedochao](https://github.com/Gedochao) in [#3341](https://github.com/VirtusLab/scala-cli/pull/3341)
194
+
* Support `coursier`-downloaded `scala` wrapper tests on Windows by [@Gedochao](https://github.com/Gedochao) in [#3325](https://github.com/VirtusLab/scala-cli/pull/3325)
195
+
* Get rid of duplicate names for uploaded/downloaded artifacts on the CI by [@Gedochao](https://github.com/Gedochao) in [#3342](https://github.com/VirtusLab/scala-cli/pull/3342)
196
+
* Retry generating the Windows launcher up to 5 times by [@Gedochao](https://github.com/Gedochao) in [#3349](https://github.com/VirtusLab/scala-cli/pull/3349)
197
+
* Retry generating Windows launchers in the `generate-native-image.sh` script directly, rather than the entire CI step by [@Gedochao](https://github.com/Gedochao) in [#3350](https://github.com/VirtusLab/scala-cli/pull/3350)
198
+
* Fix integration tests when run with a Scala 3 LTS RC version by [@Gedochao](https://github.com/Gedochao) in [#3362](https://github.com/VirtusLab/scala-cli/pull/3362)
199
+
* Retry some more flaky tests on the CI by [@Gedochao](https://github.com/Gedochao) in [#3382](https://github.com/VirtusLab/scala-cli/pull/3382)
200
+
* Run extra tests for main supported JVM versions by [@Gedochao](https://github.com/Gedochao) in [#3375](https://github.com/VirtusLab/scala-cli/pull/3375)
201
+
* tests: Add tests for issue with rereporting errors by [@tgodzik](https://github.com/tgodzik) in [#3390](https://github.com/VirtusLab/scala-cli/pull/3390)
202
+
* Add extra logs when retrying flaky tests by [@Gedochao](https://github.com/Gedochao) in [#3433](https://github.com/VirtusLab/scala-cli/pull/3433)
203
+
204
+
### Deprecations
205
+
* Deprecate `--src` and `--sources` to disambiguate with `--source` compiler option by [@Gedochao](https://github.com/Gedochao) in [#3412](https://github.com/VirtusLab/scala-cli/pull/3412)
206
+
207
+
### Documentation changes
208
+
* docs: document Scala Native flag options by [@scarf005](https://github.com/scarf005) in [#3386](https://github.com/VirtusLab/scala-cli/pull/3386)
209
+
* docs: document Scala Native flag options by [@scarf005](https://github.com/scarf005) in [#3416](https://github.com/VirtusLab/scala-cli/pull/3416)
210
+
* Back port of documentation changes to main by [@github-actions](https://github.com/github-actions) in [#3419](https://github.com/VirtusLab/scala-cli/pull/3419)
211
+
* Merge `scalafix` doc into `fix` by [@Gedochao](https://github.com/Gedochao) in [#3420](https://github.com/VirtusLab/scala-cli/pull/3420)
212
+
213
+
### Updates
214
+
* Update Scala 3 Next RC to 3.6.2-RC1 by [@Gedochao](https://github.com/Gedochao) in [#3305](https://github.com/VirtusLab/scala-cli/pull/3305)
215
+
* Update scala-cli.sh launcher for 1.5.4 by [@github-actions](https://github.com/github-actions) in [#3308](https://github.com/VirtusLab/scala-cli/pull/3308)
216
+
* Update `coursier` to 2.1.18 by [@Gedochao](https://github.com/Gedochao) in [#3312](https://github.com/VirtusLab/scala-cli/pull/3312)
217
+
* Update `scala-packager` to 0.1.31 by [@Gedochao](https://github.com/Gedochao) in [#3311](https://github.com/VirtusLab/scala-cli/pull/3311)
218
+
* Update jsoup to 1.18.2 by [@scala-steward](https://github.com/scala-steward) in [#3323](https://github.com/VirtusLab/scala-cli/pull/3323)
219
+
* Update Scala 3 Next RC to 3.6.2-RC2 by [@Gedochao](https://github.com/Gedochao) in [#3321](https://github.com/VirtusLab/scala-cli/pull/3321)
220
+
* Bump `coursier` to 2.1.19 by [@Gedochao](https://github.com/Gedochao) in [#3326](https://github.com/VirtusLab/scala-cli/pull/3326)
221
+
* Bump Typelevel toolkit to 0.1.29 by [@Gedochao](https://github.com/Gedochao) in [#3332](https://github.com/VirtusLab/scala-cli/pull/3332)
222
+
* Bump Scala 3 Next RC to 3.6.2-RC3 by [@Gedochao](https://github.com/Gedochao) in [#3334](https://github.com/VirtusLab/scala-cli/pull/3334)
223
+
* Update jsoup to 1.18.3 by [@scala-steward](https://github.com/scala-steward) in [#3338](https://github.com/VirtusLab/scala-cli/pull/3338)
224
+
* Update sbt, scripted-plugin to 1.10.6 by [@scala-steward](https://github.com/scala-steward) in [#3339](https://github.com/VirtusLab/scala-cli/pull/3339)
225
+
* Bump actions/upload-artifact & actions/download-artifact from 3 to 4 by [@Gedochao](https://github.com/Gedochao) in [#2701](https://github.com/VirtusLab/scala-cli/pull/2701)
226
+
* Update munit to 1.0.3 by [@scala-steward](https://github.com/scala-steward) in [#3346](https://github.com/VirtusLab/scala-cli/pull/3346)
227
+
* Update dependency to 0.3.2 by [@scala-steward](https://github.com/scala-steward) in [#3353](https://github.com/VirtusLab/scala-cli/pull/3353)
228
+
* Update `coursier` to 2.1.20 by [@Gedochao](https://github.com/Gedochao) in [#3356](https://github.com/VirtusLab/scala-cli/pull/3356)
229
+
* Bump Scala Next to 3.6.2 by [@Gedochao](https://github.com/Gedochao) in [#3358](https://github.com/VirtusLab/scala-cli/pull/3358)
230
+
* Bump Scala Next RC to 3.6.3-RC1 by [@Gedochao](https://github.com/Gedochao) in [#3360](https://github.com/VirtusLab/scala-cli/pull/3360)
231
+
* Update metaconfig-typesafe-config to 0.14.0 by [@scala-steward](https://github.com/scala-steward) in [#3364](https://github.com/VirtusLab/scala-cli/pull/3364)
232
+
* Update coursier-jvm_2.13, ... to 2.1.21 by [@scala-steward](https://github.com/scala-steward) in [#3363](https://github.com/VirtusLab/scala-cli/pull/3363)
233
+
* Set Scala 3.6.2 as the latest Next announced version by [@Gedochao](https://github.com/Gedochao) in [#3365](https://github.com/VirtusLab/scala-cli/pull/3365)
234
+
* Update bloop-rifle_2.13 to 2.0.6 by [@scala-steward](https://github.com/scala-steward) in [#3368](https://github.com/VirtusLab/scala-cli/pull/3368)
235
+
* Update guava to 33.4.0-jre by [@scala-steward](https://github.com/scala-steward) in [#3376](https://github.com/VirtusLab/scala-cli/pull/3376)
236
+
* Update `coursier` to 2.1.22 by [@scala-steward](https://github.com/scala-steward) in [#3378](https://github.com/VirtusLab/scala-cli/pull/3378)
237
+
* Bump the announced Scala 3 Next RC version to 3.6.3-RC1 by [@Gedochao](https://github.com/Gedochao) in [#3380](https://github.com/VirtusLab/scala-cli/pull/3380)
238
+
* Update bloop-config_2.13 to 2.2.0 by [@scala-steward](https://github.com/scala-steward) in [#3392](https://github.com/VirtusLab/scala-cli/pull/3392)
239
+
* Update `coursier` to 2.1.23 by [@scala-steward](https://github.com/scala-steward) in [#3395](https://github.com/VirtusLab/scala-cli/pull/3395)
240
+
* Update Scala 3 Next RC to 3.6.3-RC2 by [@Gedochao](https://github.com/Gedochao) in [#3398](https://github.com/VirtusLab/scala-cli/pull/3398)
241
+
* Set Scala 3.6.3-RC2 as the latest announced RC version by [@Gedochao](https://github.com/Gedochao) in [#3407](https://github.com/VirtusLab/scala-cli/pull/3407)
242
+
* Update Scala 2.13 series to 2.13.16 by [@Gedochao](https://github.com/Gedochao) in [#3418](https://github.com/VirtusLab/scala-cli/pull/3418)
243
+
* Update `coursier` to 2.1.24 by [@Gedochao](https://github.com/Gedochao) in [#3429](https://github.com/VirtusLab/scala-cli/pull/3429)
244
+
* Update Scala Next to 3.6.3 by [@Gedochao](https://github.com/Gedochao) in [#3426](https://github.com/VirtusLab/scala-cli/pull/3426)
245
+
* Update Scala Next RC to 3.6.4-RC1 by [@Gedochao](https://github.com/Gedochao) in [#3431](https://github.com/VirtusLab/scala-cli/pull/3431)
246
+
* Update bloop-config_2.13 to 2.3.1 by [@scala-steward](https://github.com/scala-steward) in [#3435](https://github.com/VirtusLab/scala-cli/pull/3435)
247
+
* Update core_2.13 to 3.10.2 by [@scala-steward](https://github.com/scala-steward) in [#3439](https://github.com/VirtusLab/scala-cli/pull/3439)
248
+
* Update scalafix-interfaces to 0.14.0 by [@scala-steward](https://github.com/scala-steward) in [#3437](https://github.com/VirtusLab/scala-cli/pull/3437)
249
+
* Update munit to 1.0.4 by [@scala-steward](https://github.com/scala-steward) in [#3441](https://github.com/VirtusLab/scala-cli/pull/3441)
250
+
* Update Scala.js to 1.18.1 by [@scala-steward](https://github.com/scala-steward) in [#3440](https://github.com/VirtusLab/scala-cli/pull/3440)
251
+
252
+
### New Contributors
253
+
* [@Vigorge](https://github.com/Vigorge) made their first contribution in [#2968](https://github.com/VirtusLab/scala-cli/pull/2968)
254
+
* [@scarf005](https://github.com/scarf005) made their first contribution in [#3386](https://github.com/VirtusLab/scala-cli/pull/3386)
0 commit comments